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.7/5
(29)
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.7/5
(44)
Correct Answer:
Verified

False

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

Free
(Multiple Choice)
4.7/5
(43)
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
(30)

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

(Multiple Choice)
4.9/5
(34)

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

(Multiple Choice)
4.9/5
(27)

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

(Multiple Choice)
4.8/5
(39)

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

(Multiple Choice)
4.7/5
(34)

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

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.8/5
(38)

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

(True/False)
4.9/5
(35)

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
(42)

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
(34)

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

(True/False)
4.9/5
(29)

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

(Multiple Choice)
4.8/5
(32)

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

(Multiple Choice)
4.9/5
(32)

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

(Multiple Choice)
4.7/5
(29)

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

(Multiple Choice)
4.8/5
(29)

The -- operator

(Multiple Choice)
4.8/5
(37)

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

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

Filters

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