Question 5
Back to Exercise
What does continue do inside a for loop?
- A Skips the rest of the current pass and moves to the update expression and the next pass Correct
- B Leaves the loop
- C Restarts the loop from the first pass
- D Pauses the loop
Correct Answer: Option A
In a for loop the update (i++) still runs after continue. In a while loop, make sure the variable is updated before continue, or the loop may never end.
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!