Previous | Home | Next |
Jump Statement # continue statement
continue statement is used to break current iteration. After continue statement the control returns to the top of the loop test conditions.
continue is a jump statement. It is analogues to break statement. Unlike break which breaks the loop, continue statement forces the next execution of loop bypassing any code in between. For for statements it causes the conditional check and increment of loop variable, for while and do-while it passes the control to the condition check jumping all the statements in between. Continue plays an important role in efficiently applying certain algorithms.
ExampleVoid main () { int r ,c; for(r=1;r<=10;r++) { if (r==5) continue; else printf(“r=%d,\n”,r); } getch(); }
Previous | Home | Next |