Question: Programming C++ Exercise 5.1.1. Write a program that defines and tests a factorial function. The factorial of a number is the product of all whole
Programming C++
Exercise 5.1.1. Write a program that defines and tests a factorial function. The factorial of a number is the product of all whole numbers from 1 to N. For example, the factorial of 5 is 1 * 2 * 3 * 4 * 5 = 120. (Hint: Use a for loop as described in Chapter 3.)
Exercise 5.1.2. Write a function named print_out that prints all the whole numbers from 1 to N. Test the function by placing it in a program that passes a number n to print_out, where this number is entered from the keyboard. The print_out function should have type void; it does not return a value. The function can be called with a simple statement:
print_out(n);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
