my code is only working till 25 number input. now its coming warning
Not working. warning is coming
hello @mittali
its becuase factorials can exceed the range of all primitive datatype , we cant use them.
so the idea is to use array.
intially the array will hold 1. (indicating 1 factorial)
and then iterate from 2 to n(to compute n!) , multiply this number with the number available in array and update the array.
for example if u have to store 23 in array then store it as
3 | 2
now let say u have to multily this number 23 with 2 .
so simply iterate this array and multiply by 2 but do take care of carry
6 | 4
for printing simply iterate from right to left
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.