Continue Statement in C/C++


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

Updated on: 24-Jun-2020

96 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements