Chapter 5 C++
What will the following code display? int number = 6; cout <« number++ < endl;
6
The scope of a variable declared in a for loop's initialization expression always extends beyond the body of the loop.
False
Something within a while loop must eventually cause the condition to become false or a(n) results.
Infinite loop
The statements in the body of a while loop may never be executed while the statements in the body of a do-while loop will be executed
O at least once
A special value that marks the end of a list of values is a
O sentinel
What is the output of the following code segment? n = 1; while (n <= 5) cout « n « i n++;
O1 1... and on forever
Multiple relational expressions cannot be placed into the test condition of a for loop.
True
A statement that may be used to stop a loop's current iteration and begin the next one is
continue
The while loop is a ——-loop.
pre-test
A while loop's body can contain multiple statements, as long as they are enclosed in braces.
• True
An initialization expression may be omitted from the for loop if no initialization is required.
• True