Question: Write a program in C++ that asks the user for a positive integer value and prints it's factorial. -the program should use a loop to
Write a program in C++ that asks the user for a positive integer value and prints it's factorial. -the program should use a loop to calculate the factorial. -your output needs to be formatted as shown below and show each integer that was multiplied to come up with the final result. -your program should only accept numbers 0-12 - note that !0 = 1. this should be a special case
Sample output run 1:
Enter a number to find its factorial (0-12): 8
!8 = 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 =40320
Sample output run 2:
Enter a number to find its factorial (0-12): 3
!3 = 1 * 2 * 3 = 6
Sample run 3:
Enter a number to find its factorial (0-12): 0
!0 = 1
Sample run 4;
Enter a number to find its factorial (0 -12 ): 20
ERROR: Valid numbers are 0 to 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
