how to think in this
Broken calciulator
since the factorials of numbers can be quite large they cannot be stored in int or even long long int datatype
so we can consider storing each digit of the factorial in an array
for eg 120 can be stored as
num : 1 2 0
similarly bigger numbers can be stored in arrays as well and it wont create a memory issue
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.
broken calculater problem not able to think.you solved this problem in first attempt
why giving segmentation fault in coding block ide but not in sublime text
Change line 3 to #define max 10000 and then check.
compilation error is coming
The code you shared was running.Just increase max to a larger value say 2000 as 500! has much larger number of digits than 200. Submit this and check if this gives any error.