Question 3
Back to Exercise
In a for loop, where does continue transfer control?
- A To the start of the body
- B To the update expression, then the condition Correct
- C Out of the loop
- D To the initialisation
Correct Answer: Option B
continue ends the current pass. In a for loop the update (i++) still runs, then the condition. In a while loop it jumps straight to the condition – which is why a continue before the increment of a while loop can cause an infinite loop.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!