Bird
0
0

Why does a do-while loop always execute its body at least once, even if the condition is false initially?

hard📝 Conceptual Q10 of 15
C - Loops
Why does a do-while loop always execute its body at least once, even if the condition is false initially?
ABecause the condition is checked after the loop body executes
BBecause the loop body is executed twice by default
CBecause the condition is ignored in the first iteration
DBecause the loop variable is initialized inside the loop
Step-by-Step Solution
Solution:
  1. Step 1: Understand loop execution order

    In a do-while loop, the body runs first, then the condition is checked.
  2. Step 2: Explain why body runs once

    Since condition is checked after body, the body always runs at least once regardless of condition.
  3. Final Answer:

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

    Condition checked after body ensures one execution [OK]
Quick Trick: Condition checked after body runs once [OK]
Common Mistakes:
  • Thinking body runs twice by default
  • Believing condition is ignored
  • Confusing variable initialization with loop control

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes