i am not able to even start to this problem
Broken calculator
Factorial of 100 has 158 digits. It is not possible to store these many digits even if we use long long int.
you have to use array here
Hint:
factorial(n)
- Create an array ‘fac[]’ of MAX size where MAX is number of maximum digits in output.let say 1000
- Initialize value stored in fac[]’ as 1 and initialize facsize as 1.
- Do following for all numbers from x = 2 to n.
……a) Multiply x with fac[] and update fac[] and facsize to store the multiplication result.
can you please help me with code for same
actually I tried your approach but it is not working as it is not efficient method
it is efficient and worked
for more efficiency you can use java biginteger class or
use python
please help me with the code
first try and share your code
then i will tell your your mistake