Broken calculator

it is working for smaller no. but for larger nos. its output is 0 how?

It is showing 0 because you are using int for fact which goes out of limit. Even if use use long long then also fact will out of limit of fact. So you have to think of some different approach.

1 Like

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.