Font size
WorksheetsChapter 7: Loops
Total questions: 11
Worksheet time: 9mins
Running the same code multiple times is called...
repetition
being on a roll
iteration
redundant
Look at the following loop:
The expression in the parentheses is called the ...
condition
return type
body
object
Look at the following code:
The statements in braces are called the...
condition
output
parameters
body
Which of the following is the increment operator?
+
++
**
--
Which of the following is the decrement operator?
**
-
--
++
Look at the following for loop. How many times will this run?
5
4
3
2
What is the output of the following loop?
$$$$$$
$$$$$
$$$$
$$
Which of the following statements decrements the variable x by 1. Choose all that apply.
x--;
x = x -1;
x == x - 1;
x++;
Which of the following statements increments the variable i by 2. Select all that apply.
i = i + 2;
i += 2;
i == i + 2;
i++;
If a loop tests a condition before the beginning of each pass through the loop, it is a
pretest loop
posttest loop
before check
secure interface
Which loop is a posttest loop?
the for loop
the while loop
the do-while loop
the enhanced for loop
