#include #include using namespace std; int factorial(int i); int main() { //Output the product of the ints from 1 to 10 inclusive. cout << factorial(10) << "\n"; return EXIT_SUCCESS; } //Return the product of the ints from 1 to n inclusive. int factorial(int n) { if (n < 0) { cerr << "Can't take the factorial of a negative number.\n"; exit(EXIT_FAILURE); } int f {1}; for (int i {1}; i <= n; ++i) { f *= i; //means f = f * i; } return f; }