Bird
0
0

You want to print all even numbers from 2 to 20 using a loop. Which loop is best and why?

hard📝 Application Q8 of 15
C - Loops
You want to print all even numbers from 2 to 20 using a loop. Which loop is best and why?
ANo loop needed, just print manually
Bwhile loop, because it runs forever
Cdo-while loop, because it runs zero times
Dfor loop, because it allows controlled increments
Step-by-Step Solution
Solution:
  1. Step 1: Understand the task

    Printing even numbers from 2 to 20 requires counting with a fixed step.
  2. Step 2: Choose loop type

    For loop is best because it allows setting start, end, and increment easily.
  3. Final Answer:

    for loop, because it allows controlled increments -> Option D
  4. Quick Check:

    Controlled counting = for loop [OK]
Quick Trick: Use for loop for fixed range and step increments [OK]
Common Mistakes:
  • Choosing while loop without control
  • Thinking do-while runs zero times
  • Ignoring loops for repetitive tasks

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes