Bird
0
0

You want to print all numbers from 1 to 10 except multiples of 3 using a loop in C. Which loop control statement should you use and where?

hard📝 Application Q15 of 15
C - Loop Control Statements
You want to print all numbers from 1 to 10 except multiples of 3 using a loop in C. Which loop control statement should you use and where?
AUse <code>continue;</code> when number is multiple of 3 to skip printing
BUse <code>break;</code> when number is multiple of 3 to stop the loop
CUse <code>break;</code> after printing multiples of 3
DUse <code>continue;</code> before the loop starts
Step-by-Step Solution
Solution:
  1. Step 1: Understand the goal

    We want to skip printing numbers that are multiples of 3 but continue the loop for others.
  2. Step 2: Choose correct loop control

    continue; skips the current iteration, so placing it when number is multiple of 3 skips printing those numbers.
  3. Final Answer:

    Use continue; when number is multiple of 3 to skip printing -> Option A
  4. Quick Check:

    Skip multiples of 3 = continue [OK]
Quick Trick: Use continue to skip unwanted iterations [OK]
Common Mistakes:
  • Using break to stop entire loop instead of skipping
  • Placing continue outside the loop
  • Trying to break after printing multiples

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes