wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C++ Chapter 5 Review - Loops

Total questions: 32

Worksheet time: 16mins

Name
Class
Date
1.
To ___ a value means to increase it by one. 
a)
increment
b)
decrement
2.
To ___ a value means to decrease it by one. 
a)
increment
b)
decrement
3.
When the increment or decrements operator is placed before the operand, the operator is being used in ___ mode
a)
postfix
b)
prefix
4.
When the increment or decrements operator is placed after the operand, the operator is being used in ___ mode
a)
postfix
b)
prefix
5.
The statement or block that is repeated is known as the __ of the loop
a)
outer
b)
inner
c)
body
d)
arm
6.
A loop that evaluates its test expression before each repetition is a(n) ___ loop
a)
pretest
b)
post-test
7.
A loop that evaluates its test expression after each repetition is a(n) ___ loop
a)
pretest
b)
post-test
8.
A loop that does not have a way of stopping is a(n) __ loop
a)
finite
b)
infinite
9.
A(n) _ is a variable that "counts" the number of times a loop repeats.
a)
sentinel
b)
accumulator
c)
running total
d)
counter
10.
This loop always iterates at least once
a)
while
b)
for loop
c)
do / while
11.
This loop is ideal for situations that require a counter
a)
while
b)
for loop
c)
do / while
12.
A loop that is inside another loop is called _ 
a)
for
b)
nested
c)
endless
d)
while
13.
A loop that is inside another loop is called _ 
a)
for
b)
nested
c)
endless
d)
while
14.
This statements causes a loop to terminate immediately
a)
continue
b)
break
15.
This statements causes a loop to skip the remaining statements in the current iteration.
a)
continue
b)
break
16.
The operand of the increment and the decrement operators can be any valid math equation.
a)
true
b)
false
17.
The operand of the increment and the decrement operators can be any valid math equation.
a)
true
b)
false
18.
The while loop is a pretest loop
a)
true
b)
false
19.
The do-while loop is a pretest loop
a)
true
b)
false
20.
the for loop is is a post-test loop
a)
true
b)
false
21.
the for loop is is a post-test loop
a)
true
b)
false
22.
it is not necessary to initialize counter variables
a)
true
b)
false
23.
all three of the for loop's expression may be omitted
a)
true
b)
false
24.
one limitations of the for loop is that only one variable may be initialized in the initialization expression
a)
true
b)
false
25.
variables may be defined inside the body of a loop
a)
true
b)
false
26.
a variable may be defined in the initialization expression of the for loop
a)
true
b)
false
27.
in a nested loop, the outer loop executes faster than the inner loop
a)
true
b)
false
28.
in a nested loop, the inner loop goes through all of its iteration for every single iteration of the outer loop
a)
true
b)
false
29.
to calculate the total number of iterations of a nested loop, add the number of iterations of all the loops
a)
true
b)
false
30.
the break statement causes a loop to stop the current iteration and begin the next one
a)
true
b)
false
31.
the continue statement causes a terminated loop to resume
a)
true
b)
false
32.
in a nested loop, the break statement only interrupts the loop it is placed in
a)
true
b)
false