Programming - C++ Language
You Are Here :: Home > C++ Language > Introduction - General Questions
31. |
A continue statement causes execution to skip to
|
A. |
the return 0; statement |
B.
|
the first statement after the loop |
C.
|
the statement following the continue statement
|
D.
|
the next iteration of the loop
|
|
Answer: Option D
Explanation:
|
32. |
In a group of nested loops, which loop is executed the most number of times?
|
A. |
the outermost loop |
B.
|
the innermost loop |
C.
|
all loops are executed the same number of times
|
D.
|
cannot be determined without knowing the size of the loops
|
|
Answer: Option B
Explanation:
|
33. |
The statement i++; is equivalent to
|
A. |
i = i + i; |
B.
|
i = i + 1; |
C.
|
i = i - 1;
|
D.
|
i --;
|
|
Answer: Option B
Explanation:
|
34. |
Which looping process is best used when the number of iterations is known?
|
A. |
for |
B.
|
while |
C.
|
do-while
|
D.
|
all looping processes require that the iterations be known
|
|
Answer: Option A
Explanation:
|
35. |
What's wrong? for (int k = 2, k <=12, k++)
|
A. |
the increment should always be ++k |
B.
|
the variable must always be the letter i when using a for loop |
C.
|
there should be a semicolon at the end of the statement
|
D.
|
the commas should be semicolons
|
|
Answer: Option D
Explanation:
|
36. |
What's wrong? while( (i < 10) && (i > 24))
|
A. |
the logical operator && cannot be used in a test condition |
B.
|
the while loop is an exit-condition loop |
C.
|
the test condition is always false
|
D.
|
the test condition is always true
|
|
Answer: Option C
Explanation:
|
« prev
next »