// p.417 // Add a loop, 0 to quit #include using namespace std; // recursive function for factorial int f(int n) { if( n==0 ) return 1; else return n * f(n-1); } int main() { int N; cout << "Max: " << INT_MAX << "\n\n"; cout << "input N for computing N! - "; cin >> N; while( N != 0 ) { cout << "N! = " << f(N) << "\n\n"; cout << "input N for computing N! (0 to quit): "; cin >> N; } return 0; }