C++ for statement An inside loop controlled by the outer loop's counter variable
#include <iostream> using namespace std; int main()// ww w .j av a2 s . c o m { int outer, inner; for (outer=5; outer>=1; outer--) { for (inner=1; inner<=outer; inner++) { cout << inner; } // End of inner loop. cout << "\n"; } return 0; }