#include int product(int n) { cout << "n (product): " << n << endl; int total; while (n > 0) { cout << "n,total (loop top): " << n << " " << total << endl; n = n-1; total = total*n; cout << "n,total (loop bottom): " << n << " " << total << endl; } return total; } int main() { int n; cin >> n; cout << product(n) << endl; /* print 1*...*n */ }