Question: Need to create this table in C code using mathematical operations. Write a program to output a table with the following formate, you may use
Need to create this table in C code using mathematical operations.
Write a program to output a table with the following formate, you may use the factorial function from Lab#1 to calculate the analytical value of factorial function at each step. n n! Stirling's | Absolute error Relative error for n = 1,2,...,10. Hint: If your computer system does not have a predefined value for TT, Use either a = acos (-1.0) or D = 4.0*atan (1.0) Sample output: Enter the number to calculate its factorial: 10 120 Stirling's 0.922137 1.919004 5.836210 23.506175 118.019168 710.078185 4980.395832 39902.395453 359536.872842 3598695.618741 Absolute error 0.077863 0.080996 0.163790 0.493825 1.980832 9.921815 59.604168 417.604547 3343.127158 30104.381259 Relative error 0.077863 0.040498 0.027298 0.020576 0.016507 0.013780 0.011826 0.010357 0.009213 0.008296 720 5040 40320 362880 3628800 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
