Demonstrates the use of the continue statement. - C++ Statement

C++ examples for Statement:continue

Description

Demonstrates the use of the continue statement.

Demo Code

#include <iostream>
using namespace std;
int main()//from w  ww.ja v a  2  s  .  com
{
   int ctr;
   for (ctr=1; ctr<=10; ctr++)      // Loop 10 times.
   {
      cout << ctr << " ";
      continue;        // Causes body to end early.
      cout << "C++ Programming\n";
   }
   return 0;
}

Result


Related Tutorials