Continue In C


If we want to skip some statement in a loop then we can use there continue statement. It mostly used when to skip the rest of the statement in the current loop and start from the top again.


Simple example of continue statement in c


#include <stdio.h>

#include<conio.h>

void main()

{

int i=1;

clrscr();

for(i=1;i<=5;i++)

{

if(i==4)

{

continue;

}

printf(“Welcome %d\n”,i);

}

printf(“Exit from loop here”);

getch();

}


Output:
welcome 1
welcome 2
welcome 3
welcome 4
welcome 5
Exit from loop here