C++ for statement Leave the for loop incremental part empty

Description

C++ for statement Leave the for loop incremental part empty

#include <iostream>
using namespace std;
int main()/*  w w  w . j ava  2 s  . c om*/
{
   int count;
   count = 2;    // initializer outside the for loop
   for ( ; count <= 20; )
   {
      cout << count << "  ";
      count = count + 2;    // altering statement
   }
   return 0;
}



PreviousNext

Related