continue statement in C ?


The continue statement in C language is used to bring the program control to the beginning of the loop. The continue statement skips some lines of code inside the loop and continues with the next iteration.

Syntax:-

While(condition)
{
action -1
continue;
action n;
}

Note: "Whenever a continue statement is executed, the rest of the statements within the body of the loop are skipped and the conditional expression in the loop is executed."

Q.) W.A.P to print 1 3 4 5.
 #include<stdio.h>
 #include<conio.h>
 void main()
 {
 int i ;
 for( i=1;i<=5;i++)
 {
 if(i==2)
 {
 continue;
 }
 printf(“%d”,i);
 }
 getch();
 }
Output
1
3
4
5
For More Details click