What data type should be used to save the answer for calculating 100! ??? I tried using long long int but it wasn’t able to pass all the test cases.
Appropriate data type selection
@jha.aparna17 there is no datatype big enough in c++ to store such a large value. You will have to store the digits individually in an array.
But when i used long double and provided custom input, i got the right answer
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.