#include "NestedLoops.h" #include using std::cout; using std::cin; using std::endl; void NestedForLoop(size_t n, size_t m) { for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { cout << "i = " << i << ", j = " << j << endl; cout << "the product of the incrementers are; " << i * j << endl; } } } void NestedWhileLoop(size_t n, size_t m) { int i = 0; while (i < n) { int j = 0; while (j < m) { cout << "n = " << i << ", m = " << j << endl; cout << "the product of the incrementers are; " << i * j << endl; j++; } cout << endl; i++; } } void NestedDoWhileLoop(size_t n, size_t m) { int i = 0; do { int j = 0; do { cout << "n = " << i << ", m = " << j << endl; cout << "the product of the incrementers are; " << i * j << endl; j++; } while (j <= m); cout << endl; i++; } while (i <= n ); }