Write a program that defines and tests a factorial function


Programming C++

Exercise 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 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);

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program that defines and tests a factorial function
Reference No:- TGS02900850

Expected delivery within 24 Hours