Exam 5: Looping

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

A while loop is somewhat limited, because the counter can only count up, not down.

Free
(True/False)
4.8/5
(71)
Correct Answer:
Verified

False

When a loop is nested inside another loop, the outer loop goes through all its iterations for each iteration of the inner loop.

Free
(True/False)
4.8/5
(98)
Correct Answer:
Verified

False

If a while loop has no braces around the body of the loop

Free
(Multiple Choice)
4.7/5
(89)
Correct Answer:
Verified

C

A while loop may have a semicolon after the test expression and before the body of the loop, but it is not required.

(True/False)
4.8/5
(68)

A(n) ________ is a variable that is regularly incremented or decremented each time a loop iterates.

(Multiple Choice)
4.8/5
(75)

In a for statement, the ________ expression is executed only once.

(Multiple Choice)
4.9/5
(59)

The do-while loop is a(n) ________ loop, whereas the while loop is a(n) ________ loop.

(Multiple Choice)
4.9/5
(95)

The statements in the body of a do-while loop are executed

(Multiple Choice)
4.7/5
(84)

To use files in a C++ program you must include the ________ header file.

(Multiple Choice)
4.9/5
(85)

To use an output file in a C++ program you must

(Multiple Choice)
4.9/5
(79)

An initialization expression may be omitted from the for loop if no initialization is required.

(True/False)
4.9/5
(81)

When a loop is nested inside another loop, the inner loop goes through all its iterations for each iteration of the outer loop.

(True/False)
5.0/5
(93)

You can nest a for loop inside another for loop, but cannot nest a while loop inside another while loop or a do-while loop inside another do-while loop.

(True/False)
4.9/5
(70)

Before beginning to add value to it, an accumulator should be initialized to 1.

(True/False)
4.8/5
(77)

________ are C++ operators that change their operands by one.

(Multiple Choice)
4.8/5
(76)

To use files in a C++ program you must include the ________ header file.

(Multiple Choice)
4.9/5
(71)

You may define a(n) ________ in the initialization expression of a for loop.

(Multiple Choice)
4.7/5
(77)

The while loop has two important parts: a condition that is tested and a statement or block of statements that is

(Multiple Choice)
4.9/5
(70)

The -- operator

(Multiple Choice)
4.8/5
(84)

A for statement contains three expressions: initialization, test, and

(Multiple Choice)
4.9/5
(82)
Showing 1 - 20 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)