I need help to write this C not C++. Thanks very much for the help whoever helps me.
1) The factorial of a number x is given as (recursive version and iterative version respectively):
i. Fac( x )={1 if x= 0
x∗Fac(x−1) ifx>1 }
ii. Fac(x )=x∗(x−1)∗(x−2)∗(x−3)∗…∗1
a. Write separate algorithms for both versions (iterative and recursive) using pseudocode
b. Build a trace table (using x = 5) for both versions to ensure they perform as expected
c. Convert both algorithms into C code on paper
d. Create a folder called Repetition
e. Using your IDE, create a C project called Factorial in the folder called Repetition
f. Write a main module in C that displays “Calculating factorials using repetition” and pauses
until the user presses a key, then ends.
g. Write a C module called Fact() that implements your iterative algorithm from a. above, and
place the module below main() in the C sources section. Remember to write the prototype
for the function above main().
h. Call the Fact() module from main() with 5 as the argument and display the result returned.
Do not modify the Fact() module in any way (no display or hardcoding of 5). For example,
from main(), your program should display “The factorial of 5 is 120”. Run the program.
i. Comment out the iterative Fact() module you wrote in g. above.
j. Write a new C module called Fact() that implements your recursive algorithm from a.
above, and place the module below main() and the iterative version of Fact(), in the C
sources section. Do not modify the function prototype above main() or the function call
from main().
k. Run the program again. The results should be the same as before.
This is not a home work, so for you information you need to ask questions before you make assumptions!!! I am new to programming and came across this question trying to figure out where to start.
I think the reason you got this reaction is that the original question contains step-by-step instructions on what you need to do. In other words, there is already a lot of helpful information in the question itself. You just need to start at step a. and work through it a step at a time.