Question: Write a C + + program that takes a positive integer n as input and prints the factorial of n as the output. The factorial

Write a C++ program that takes a positive integer n as input and
prints the factorial of n as the output. The factorial of a positive integer n, denoted as n!,
is the product of all positive integers less than or equal to n. For example, 4!=24 because
4!=4\times 3\times 2\times 1.
Specific Policy: Functions have not been covered in this class so far. Even if you are
familiar with them, it is not permitted to use functions to implement this program.
Sample Input:
4
Sample Output:
24
2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!