« Previous                                                                 Next Chapter »
Continue Statement

Sometimes, it is necessary to skip a part of loop under specific conditions. So, C supports 'continue' statement to do this. The working structure of 'continue' is similar as that of that break statement but difference is that it cannot terminate the loop. It causes the loop to be continued with next iteration after skipping statements in between. Continue statement simply skips statements and continues next iteration.

Syntax: continue; 

Example:
/* program for continue statement */
#include<stdio.h>
#include<conio.h>
main()
{
int i;
clrscr();
for(i=0;i<=10;i++)
{
if(i==5)
{
continue;
}
printf("%d ",i);
}
}

  « Previous                                                                  Next Chapter »