Continue statement in C in C Language
Updated on May 31, 2025 | By Learnzy Academy
In C programming, the continue statement is used to skip the current iteration of a loop and move to the next iteration. When a continue statement is encountered inside a loop, it skips the remaining code inside the loop for that particular iteration and proceeds with the next iteration of the loop.
Syntax of continue
continue;
Where continue is useful:
- Filtering data in loops: When you want to skip certain elements based on specific conditions (e.g., skipping invalid input or certain values in an array).
- Avoiding unnecessary computations: If certain conditions are met, skip the rest of the operations in that iteration (e.g., avoiding further checks when a condition is met early).
- Improving performance: Reducing unnecessary processing in the loop, especially when complex calculations or checks are involved.
Key Points:
- continue only affects the current iteration of the loop.
- It does not terminate the loop (for that, you would use break).
- It's typically used with an if statement to decide when to skip certain iterations.
Click here to download practice questions on
Continue statement in C