Leave for loop initialization part empty - C++ Statement

C++ examples for Statement:for

Description

Leave for loop initialization part empty

Demo Code

#include <iostream>
using namespace std;
int main()//  ww w  .  ja va2  s .  co  m
{
   int count;
   count = 2;    // initializer outside the for statement
   for ( ; count <= 20; count = count + 2)
      cout << count << "  ";
   return 0;
}

Result


Related Tutorials