WorksheetsLOOPS IN C++
Total questions: 10
Worksheet time: 20mins
How many loops are there in C++
2
3
4
1
What is currect syntax of for loop?
for(initialization;condition; increment/decrement)
for(increment/decrement; initialization; condition)
for(initialization, condition, increment/decrement
None of These
Can a for loop contain another for loop?
No
Yes
Compilation Error
Runtime Error
Each pass through a loop is called a/an
pass through
enumeration
iteration
culmination
Which looping process checks the test condition at the end of the loop?
for
while
do-while
no looping process checks the test condition at the end
In a group of nested loops, which loop is executed the most number of times?
the outermost loop
the innermost loop
all loops are executed the same number of times
cannot be determined without knowing the size of the loops
The statement i++; is equivalent to
i = i + i;
i = i + 1;
i = i - 1;
i --;
Which looping process is best used when the number of iterations is known?
for
while
do-while
all looping processes require that the iterations be known
What's wrong? for (int k = 2, k <=12, k++)
the increment should always be ++k
the variable must always be the letter i when using a for loop
there should be a semicolon at the end of the statement
the commas should be semicolons
If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block?
parentheses ( )
braces { }
brackets [ ]
arrows < >
