This occurs because of integer overflow. Try finding factorial of say 50 with your program & cross check it against the Windows / or any other calculator. Check out this link for range of values data types in C can handle : http://www.tutorialspoint.com/ansi_c/c_basic_datatypes.htm
To solve this problem you’ll need to use GNU MP Bignum Library, check this link : http://gmplib.org/ or you can design your own container using arrays with functions to perform operations such as addition, multiplication, etc.
Or you can use another programming language with built in BigInteger support such as JAVA, Python, etc. which is what I did, my code in python is here if you’ll like to view it : https://github.com/Ouditchya/SPOJ/blob/master/FCTRL2.py