1.6.7 continue

The continue statement can only appear in a loop body. It causes the rest of the statement body in the loop to be skipped.

Syntax:

continue;

Examples:

for(loop=0;loop<100;loop++)
 {
  if(loop==50)
    continue;
  printf("%i\n",loop);
 }

The numbers 0 through 99 are printed except for 50.

joe=0;
while(joe<1000)
 {
 for(zip=0;zip<100;zip++)
  {
   if(joe==500)
    continue;
   printf("%i\n",joe);
  }
 joe++;
}

Each number from 0 to 999 is printed 100 times except for the number 500 which is not printed at all.