// FILE: NestLoop.cpp // ILLUSTRATES A PAIR OF NESTED FOR LOOPS #include // needed for cin and cout #include // needed for setw int main () { // print heading cout << setw(12) << "i" << setw(6) << "j" << endl; for (int i = 0; i < 4; i++) { cout << "Outer" << setw (7) << i << endl; for (int j = 0; j < i; j++) cout << " Inner" << setw (11) << j << endl; } // end for - outer loop return 0; }