Write a program to calculate the factorial by means of a function. Note: The res
ID: 3617511 • Letter: W
Question
Write a program to calculate the factorial by means of a function.
Note: The result will not be accurate for relatively larger numbers with
the built-in C++ data types.
Expected Output:
(i)
Enter a number for factorial computation and press ENTER: 5
5! (by Factorial Function) is 120
(ii)
Enter a number for factorial computation and press ENTER: 23
23! (by Factorial Function) is 25852016738884978000000
(iii)
Enter a number for factorial computation and press ENTER: 38
38! (by Factorial Function) is 523022617466601040000000000000000000000000000
Explanation / Answer
#include long getFactorial(intnum) { int fact=1; for(int i=2;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.