long fact(int nu)
// your code goes here
So,you are getting wrong answer for this problem because factorial above 20 can’t be accommodated in the predefined data types.100! has approx. 150+ digits.Try to think and find a way to store each digit in an array.If you are not able to get that still,don’t worry chef’s have a solution for that too!
Here’s the tutorial for this problem:-
Hope this helps.