C++ examples for Statement:for
For statement is convenient to create fixed-count loops.
#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; }