Important MCQ

Which loop runs once even when the condition is initially false?

Q.Which loop runs once even when the condition is initially false?

A) for
B) if
C) while
D) do-while
Correct Answer:
Option D
Detailed Explanation:
D) do-while is correct. A do-while loop executes its body before checking the condition, so it runs at least once. Its closing while(condition) is followed by a semicolon.