Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre

C Language Programming Library Reference Guide

Products

Sitemap

Online
Calculators

Circuits (A-C)

Circuits (D-O)

Circuits (P-Z)

Tutorials


 
Google
 
Web Hobbyprojects.com

Statements - 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.
Search
Custom Search

<<<  Back to C Language Library Reference Guide

<<<  Back to Electronics Tutorials