Continue Statement in C/C++

CC++Server Side Programming

Continue statement is loop control statement. It works opposite the break statement and force to execute the next statements.

Here is the syntax of continue statement in C language,

continue;

Here is an example of continue statement in C language,

Example

 Live Demo

#include <stdio.h>
int main () {
   int a = 50;
   do {
      if( a == 55) {
         a = a + 1;
         continue;
      }
      printf("Value of a: %d\n", a);
      a++;
   } while( a < 60 );
   return 0;
}

Output

Value of a: 50
Value of a: 51
Value of a: 52
Value of a: 53
Value of a: 54
Value of a: 56
Value of a: 57
Value of a: 58
Value of a: 59
raja
Published on 08-Oct-2018 12:12:05
Advertisements