C++ examples for Statement:for
A nested for loop is a for loop inside a for loop.
#include <iostream> using namespace std; int main()/*w ww . j av a 2 s.c o m*/ { for (int x = 1; x <= 10; x++) { cout << "Products of " << x <<endl; for (int y = 1; y <= 10; y++) { cout << x * y << endl; } cout << endl; } return 0; }