@sameerkhan005 : You can’t store factorials of numbers upto 100 in “integer” or “long” or “long long” .
You need to implement some sort of “BigInteger” class for this problem .
@sameerkhan005: you have to initialize fact to 1 in the outer ‘for’ loop. In your code when you take second input for calculating the factorial, previous result is already in the ‘fact’ variable. To correct this you just have to insert the statement “fact=1;” just before or after “scanf(”%d",&x);".
yes that is another bug . But you wont get “Correct Answer” till you handle overflow