#include #include using namespace std; int factorial(int n); int main() { cout << "The factorial of 4 is " << factorial(4) << ".\n"; int i = factorial(5); cout << "The factorial of 5 is " << i << ".\n"; return EXIT_SUCCESS; } int factorial(int n) { if (n < 0) { cerr << "argument " << n << " can't be negative.\n"; return 0; } int f = 1; for (int i = 1; i <= n; ++i) { f *= i; } return f; //Create a copy of f and return it. }