FACT25- CODE ERA

I used the code http://www.codechef.com/viewsolution/6439428 to solve the question http://www.codechef.com/CDER2015/problems/FACT25 . My code got accepted, but in my machine, it is showing 0 if the input number is greater than 20. Please tell me why is it happening??

the test cases for the problem must be weak!