i have been asked in a test to find out the factorial of a large number.how to do it in c++?
Factorial of a big number issue
Factorial of big numbers say 50 cannot be stored in any data type. Even long long int cannot support that because Factorial of 50 is 30414093201713378043612608166064768844377641568960512000000000000 which is greater that 10^16. So simple approach of finding factorial will not work here as you cannot store such large number. So instead you should maintain an array to store each digit of such large number.
Refer this article:
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.