Put cout statement into for loop controlling statement - C++ Statement

C++ examples for Statement:for

Description

Put cout statement into for loop controlling statement

Demo Code

#include <iostream>
using namespace std;
int main()    // all expressions inside for's parentheses
{
   int count;//from  ww w  .j  a va  2  s. co m
   for (count = 2; count <= 20; cout << count << "  ", count = count + 2);
   return 0;
}

Result


Related Tutorials