n! almostequalto (n^n) (e^-n) Squareroot (pi) (2n + 1/3) Write a small script fi
ID: 3862944 • Letter: N
Question
n! almostequalto (n^n) (e^-n) Squareroot (pi) (2n + 1/3) Write a small script file to determine the factorial of an arbitrary integer number using Gosper's equation and round it to the nearest integer. The program must prompt the user to enter a number n and then determines its factorial Fact_n using Gosper's equation and then round it to the nearest integer using the round function. You must display the result as an integer using the fprintf () function in a sentence that reads, "The factorial of xx is xxxx". The program must not exceed 3 lines.Explanation / Answer
n = input("Enter number to find its factorial: ");
Fact_n = round((n^n)*(e^(-n))*sqrt((pi)*(2*n + 1.0/3)));
fprintf("The factorial of %d is %d ", n, Fact_n);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.