For statement is convenient to create fixed-count loops. - C++ Statement

C++ examples for Statement:for

Description

For statement is convenient to create fixed-count loops.

Demo Code

#include <iostream>
using namespace std;
int main()/*from   w  ww  .  jav  a2  s  .  c om*/
{
   int count;
   for (count = 2; count <= 20; count = count + 2)
      cout << count << "  ";
   return 0;
}

Result


Related Tutorials