The do-while loop is a __________ loop that is ideal in situations where you always want
the loop to iterate at least once.
ANone of these
Bnull-terminated
Cpost-test
Dinfinite
Epre-test
2.
What will the following code display?
int number = 6
int x = 0;
x = --number;
cout << x << endl;
A6
B7
C0
D5
3.
This operator increments the value of its operand, then uses the value in context.
Aprefix decrement
Bprefix increment
Cpostfix decrement
DNone of these
Epostfix increment
4.
How many times will the following loop display "Hello"?
for (int i = 0; i <= 20; i++)
cout << "Hello!" << endl;
A21
B19
C20
DAn infinite number of times
5.
Something within a while loop must eventually cause the condition to become false, or a(n)
__________ results.
Acompiler error
Bnull value
CNone of these
Dunexpected exit
Einfinite loop
6.
In a for statement, this expression is executed only once.
Anull
Btest
Cvalidation
Dinitialization
ENone of these
7.
These are operators that add and subtract one from their operands.
Abinary and unary
Bconditional and relational
Cplus and minus
DNone of these
E++ and --
8.
This is a special value that marks the end of a list of values.
Asentinel
Bconstant
CNone of these
Dvariable
Eloop
9.
The do-while loop is considered a(n) _________ loop.
Apost-test
Bpre-test
CNone of these
Dinfinite
Elimited
10.
This is a control structure that causes a statement or group of statements to repeat.
Aconstant
Bcout object
Cdecision statement
DNone of these
Eloop
the loop to iterate at least once.
What will the following code display?
int number = 6
int x = 0;
x = --number;
cout << x << endl;
This operator increments the value of its operand, then uses the value in context.
How many times will the following loop display "Hello"?
for (int i = 0; i <= 20; i++)
cout << "Hello!" << endl;
Something within a while loop must eventually cause the condition to become false, or a(n)
__________ results.
In a for statement, this expression is executed only once.
These are operators that add and subtract one from their operands.
This is a special value that marks the end of a list of values.
The do-while loop is considered a(n) _________ loop.
This is a control structure that causes a statement or group of statements to repeat.