Question 2
Back to Exercise
What does for (;;) { … } do?
- A It does not compile
- B It runs once
- C It is an infinite loop – a missing condition counts as true Correct
- D It never runs
Correct Answer: Option C
All three parts of a for header are optional, and an empty condition is treated as true. for (;;) is the classic infinite loop, left with break or return.
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!