#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"; exit(EXIT_FAILURE); } int f {1}; for (int i {1}; i <= n; ++i) { f *= i; //means f = f * i } return f; //Create a copy of the value of f and return it to the caller. }