How to solve broken calculator problem? Is there any live doubt clearing session?
Broken calculator
hello @1ms18im021
since factorials can exceed the range of all primitive datatype , we cant use them.
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
pls refer this code for clartiy->
i am not sure, pls ask this query from support team.
email -> [email protected]
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.