Monday, April 25, 2016

Continue Statement


Image result for continue

For the for loop, continue statement causes the conditional test and increment portions of the loop to execute. For the while and do...while loops,continue statement causes the program control to pass to the conditional tests.



Example : 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>

int main () {

   int a = 10;

   do {

      if( a == 15) {

         a = a + 1;
         continue;
      }

      printf("value of a: %d\n", a);
      a++;

   } while( a < 20 );

   return 0;
}


Output : 





Share this

0 Comment to "Continue Statement "

Post a Comment