Question: Write two programs to calculate the factorial of a given input integer in two ways: a . Use a for loop b . Use recursion
Write two programs to calculate the factorial of a given input integer in two ways:
a Use a for loop
b Use recursion
Your results variable must be an unsigned long long b Test your programs and make sure they work. What is the maximum input value without causing an overflow results needs to be correct After testing your programs, you will use a Linux system utilitycommand called time to time these two programs with the maximum input value. Run these two programs times each with time Record your results and calculate the average of these runs for each program. Turn in a table of your timing values. Discuss what you have observed.
second partChange you program to have results in double What is the max input value not resulting in inf Run your two programs with the max input value times each and record the running time with the Linux system command time Discuss what you have observed from these results.
Turn in your program as well as screen capture for running your program besides answering questions and discussion.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
