Which of the following causes an infinite loop?
Show answerHide answer
Correct answer: (C) while (1) { }
Explanation
while (1) has a condition that is always true (non-zero) and nothing inside the body to break out, so it never ends. The for loops terminate and do { } while (0) runs once.