Question: Create a program in C with a function factorial using the code given to you in the book for recursively creating a factorial sequence 6-25.
Create a program in C with a function "factorial" using the code given to you in the book for recursively creating a factorial sequence 6-25.
You need to write main program which will prompt the user for "n" and then call the factorial function by value. Your returned value should be printed out to the user.
6-25 Recursive Factorial:
me Calculate the factorial of There is no test that the result Pre n is the number to Post result is returned lal of a number using a loop- the result fits in a long. number to be raised factorially long factorial (int n) // Local Declarations long facts = 1; 10 Statements for (int i = 1; facts = facts * i; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
