i am unable to solve this problem as there is no datatype for storing such a large number.
so what is the approach for this problem
i am unable to solve this problem as there is no datatype for storing such a large number.
so what is the approach for this problem
@shivamgoel150
Calculating factorial is not a tough job, but storing a very big result of multiplication is a difficult task.
Is there any datatype available which stores these many digits at once?
No, there is no such data type available.
Then, what to use?
Array, is what you are looking for.
Array can solve your problem.
example:
Input :50
Output : 3041409320171337804361260816606476884-
4377641568960512000000000000
Algorithm to calculate factorial:
factorial()
easy?
Algorithm for multiplication:
multiply(res[], x)
Hope, this would help.
if yes dont forget to mark it as resolved 