C++ for statement Leave for loop initialization part empty

Description

C++ for statement Leave for loop initialization part empty

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



PreviousNext

Related