C++ continue statement end loop body earlier

Description

C++ continue statement end loop body earlier

#include <iostream>
using namespace std;
int main()/*from   w  w  w .  ja va  2 s .co  m*/
{
   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;
}



PreviousNext

Related