Filters
Question type

Study Flashcards

You may not use the break statement in a nested loop.

A) True
B) False

Correct Answer

verifed

verified

You may nest while and do-while loops, but you may not nest for loops.

A) True
B) False

Correct Answer

verifed

verified

The while loop contains an expression that is tested for a true or false value, and a statement or block that is repeated as long as the expression:


A) is false
B) is true
C) does not evaluate to true or false
D) evaluates to true or false
E) None of these

F) A) and E)
G) A) and B)

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

How many times will the following loop display "Hello"? How many times will the following loop display  Hello ?   A) 20 B) 19 C) 21 D) An infinite number of times


A) 20
B) 19
C) 21
D) An infinite number of times

E) A) and B)
F) C) and D)

Correct Answer

verifed

verified

Something within a while loop must eventually cause the condition to become false, or a(n) ________ results.


A) null value
B) infinite loop
C) unexpected exit
D) compiler error
E) None of these

F) A) and D)
G) B) and C)

Correct Answer

verifed

verified

The do-while loop is a(n) ________ loop that is ideal in situations where you always want the loop to iterate at least once.


A) post-test
B) pre-test
C) infinite
D) null-terminated
E) None of these

F) All of the above
G) A) and C)

Correct Answer

verifed

verified

The while loop is this type of loop.


A) post-test
B) pre-test
C) infinite
D) limited
E) None of these

F) A) and B)
G) B) and C)

Correct Answer

verifed

verified

This is a special value that marks the end of a list of values.


A) constant
B) variable
C) loop
D) sentinel
E) None of these

F) A) and B)
G) A) and C)

Correct Answer

verifed

verified

This means to increase a value by one.


A) decrement
B) increment
C) modulus
D) parse
E) None of these

F) B) and D)
G) B) and C)

Correct Answer

verifed

verified

When the increment operator precedes its operand, as in ++num1, the expression is in this mode.


A) postfix
B) prefix
C) preliminary
D) binary
E) None of these

F) A) and D)
G) D) and E)

Correct Answer

verifed

verified

This is a control structure that causes a statement or group of statements to repeat.


A) decision statement
B) constant
C) loop
D) cout object
E) None of these

F) None of the above
G) C) and D)

Correct Answer

verifed

verified

The statements in the body of a while loop may never be executed, whereas the statements in the body of a do-while loop will be executed:


A) at least once
B) at least twice
C) as many times as the user wishes
D) never
E) None of these

F) A) and E)
G) A) and B)

Correct Answer

verifed

verified

If you want a user to enter exactly 20 values, which loop would be the best to use?


A) do-while
B) for
C) while
D) infinite
E) None of these

F) A) and E)
G) B) and C)

Correct Answer

verifed

verified

The scope of a variable declared in a for loop's initialization expression always extends beyond the body of the loop.

A) True
B) False

Correct Answer

verifed

verified

In C++ 11 you can pass a string object as argument to a file stream object's open member function.

A) True
B) False

Correct Answer

verifed

verified

This statement may be used to stop a loop's current iteration and begin the next one.


A) break
B) terminate
C) re-iterate
D) continue
E) None of these

F) B) and C)
G) C) and D)

Correct Answer

verifed

verified

It is possible to define a file stream object and open a file in one statement.

A) True
B) False

Correct Answer

verifed

verified

This is a variable that is regularly incremented or decremented each time a loop iterates.


A) constant
B) counter
C) control statement
D) null terminator
E) None of these

F) A) and E)
G) None of the above

Correct Answer

verifed

verified

How many times will the following loop display "Hello"? How many times will the following loop display  Hello ?   A) 20 B) 19 C) 21 D) An infinite number of times


A) 20
B) 19
C) 21
D) An infinite number of times

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

Showing 41 - 60 of 63

Related Exams

Show Answer