C++ examples for Statement:for
For loop count
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { int nLoopCount; cout << "Enter loop count: "; cin >> nLoopCount;/* w ww. jav a 2s. c om*/ for (; nLoopCount > 0;){ nLoopCount = nLoopCount - 1; cout << "Only " << nLoopCount << " loops to go" << endl; } return 0; }