Bird
0
0

You want to print numbers from 1 to 15 but skip numbers divisible by 4 using a loop in C. Which loop control statement should you use and where?

hard📝 Application Q8 of 15
C - Loop Control Statements
You want to print numbers from 1 to 15 but skip numbers divisible by 4 using a loop in C. Which loop control statement should you use and where?
AUse continue inside the loop when number % 4 == 0
BUse break inside the loop when number % 4 == 0
CUse return inside the loop when number % 4 == 0
DUse goto to skip numbers divisible by 4
Step-by-Step Solution
Solution:
  1. Step 1: Understand the requirement

    Skip printing numbers divisible by 4.
  2. Step 2: Choose appropriate control

    continue skips current iteration without exiting the loop.
  3. Step 3: Apply condition

    Inside the loop, if number % 4 == 0, use continue to skip printing.
  4. Final Answer:

    Use continue inside the loop when number % 4 == 0 -> Option A
  5. Quick Check:

    continue skips unwanted iterations [OK]
Quick Trick: Use continue to skip specific iterations [OK]
Common Mistakes:
  • Using break which exits the loop entirely
  • Using return which exits the function
  • Using goto which complicates flow unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes