Table of Contents
continue statement in C
In C program continue statement is use to force loop to stop current iteration and start executing next iteration.
In simple terms continue statement is use to stop current execution of loop and start with next iteration we can use continue with if-else statement and when certain condition is matched we can start next iteration.

Example of continue statement with while loop
#include<stdio.h>
void main()
{
int i=0;
while(i<=5)
{
i++;
if(i == 3)
{
continue;
}
printf("%d ITVoyagers n",i);
}
}
Output:
1 ITVoyagers
2 ITVoyagers
4 ITVoyagers
5 ITVoyagers
In above example while loop will starting iterating because initial condition is valid and it will print value of i followed by ITVoyagers, but when value of i reaches to 3 then condition for inner if statement gets true and this will execute continue statement, which will force while loop to stop current iteration and start with next iteration, hence “3 ITVoyagers” is missing from output.
Example of continue statement with do-while loop
#include<stdio.h>
void main()
{
int i=0;
do
{
i++;
if(i == 3)
{
continue;
}while(i<=5);
printf("%d ITVoyagers n",i);
}
}
Output:
1 ITVoyagers
2 ITVoyagers
4 ITVoyagers
5 ITVoyagers
Example of continue statement with for loop
#include<stdio.h>
void main()
{
int i;
for(i=0; i<=5; i++)
{
if(i == 3)
{
continue;
}
printf("%d ITVoyagers n",i);
}
}
Output:
0 ITVoyagers
1 ITVoyagers
2 ITVoyagers
4 ITVoyagers
5 ITVoyagers
Try this practice quiz
CHECKOUT OTHER RELATED TOPICS
CHECKOUT OTHER QUIZZES
Quizzes on Operator |
Easy Quiz on Operators in C part 1 |
Easy quiz on operators in C part 2 |
Easy quiz on operators in C part 3 |
Quizzes on Loops |
Easy quiz on loops in C part 1 |
Easy quiz on loops in C part 2 |
Easy quiz on loops in C part 3 |
Quizzes on Decision Making Statement |
Easy Quiz On Decision Making Statements Part 1 |
Easy Quiz On Decision Making Statements Part 2 |
Quizzes on String |
Easy quiz on String in C programming part 1 |
Quizzes on Array |
Easy quiz on Array in C programming – part 1 |
5 – Best Java program to convert decimal to binary |
New Quizzes Coming soon.. |
PRACTICALS IN C PROGRAM
Programs to understand the basic data types and I/O.
Programs on Operators and Expressions.
Programs on decision statements.
Programs on looping.
Programs to understand the basic data types and I/O.
Programs on arrays.
Programs on functions.
Programs on structures and unions.
Programs on pointers.
Programs on string manipulations.
