Important MCQ

A while loop checks its condition

Q.A while loop checks its condition

A) only once at the end
B) never
C) after each iteration
D) before each iteration
Correct Answer:
Option D
Detailed Explanation:
D) before each iteration is correct. A while loop checks its condition before each iteration, so it may run zero times. The loop body must update state when needed to avoid an unintended infinite loop.