Bird
0
0

Which of the following is the correct way to use the continue statement inside a for loop in C?

easy📝 Syntax Q3 of 15
C - Loop Control Statements
Which of the following is the correct way to use the continue statement inside a for loop in C?
Afor (int i = 0; i < 5; i++) { if (i == 2) skip; }
Bfor (int i = 0; i < 5; i++) { continue if (i == 2); }
Cfor (int i = 0; i < 5; i++) { if (i == 2) continue; }
Dfor (int i = 0; i < 5; i++) { if (i == 2) break continue; }
Step-by-Step Solution
Solution:
  1. Step 1: Review syntax of continue

    The continue statement is used alone to skip the current iteration.
  2. Step 2: Analyze options

    for (int i = 0; i < 5; i++) { if (i == 2) continue; } correctly uses if (i == 2) continue; inside the loop body.
  3. Final Answer:

    for (int i = 0; i < 5; i++) { if (i == 2) continue; } -> Option C
  4. Quick Check:

    Correct syntax is just continue; inside condition [OK]
Quick Trick: Use 'continue;' alone inside loop body [OK]
Common Mistakes:
  • Writing 'continue if' instead of 'if (...) continue;'
  • Using invalid keywords like 'skip'
  • Combining break and continue incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes