Bird
0
0

Why does a do-while loop always execute its body at least once?

hard📝 Conceptual Q10 of 15
C - Loops
Why does a do-while loop always execute its body at least once?
ABecause the loop body is executed before the program starts.
BBecause the loop condition is always true initially.
CBecause the loop uses a fixed number of iterations.
DBecause the condition is checked after the loop body executes.
Step-by-Step Solution
Solution:
  1. Step 1: Understand do-while loop flow

    The loop body runs first, then the condition is checked to decide continuation.
  2. Step 2: Compare with other loops

    Unlike while, do-while guarantees one execution before condition check.
  3. Final Answer:

    Because the condition is checked after the loop body executes. -> Option D
  4. Quick Check:

    Do-while checks condition after body [OK]
Quick Trick: Do-while checks condition after body runs [OK]
Common Mistakes:
  • Thinking condition is checked before body
  • Assuming fixed iteration count
  • Confusing with while loop behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes