C Tutorial/Statement/Continue

Материал из C\C++ эксперт
Перейти к: навигация, поиск

The continue statement

continue statement breaks the current iteration.


<source lang="cpp">#include<stdio.h> main(){

   int i;
   for(i = 0; i < 11; i++){
      if ((i == 4) || (i == 7)) {
         continue;
      }
      printf(" the value of i is %d\n", i);
   }

}</source>

the value of i is 0
      the value of i is 1
      the value of i is 2
      the value of i is 3
      the value of i is 5
      the value of i is 6
      the value of i is 8
      the value of i is 9
      the value of i is 10