What is the maximum input? I think 12! > INT_MAX. You can use the recurrence relation fac(n) = n*fac(n-1), however it's really sluggish. You could convert it to a loop, since it's tail recursion, however it's still sluggish for big numbers.
If there exists a way to quickly calculate n! for large n, then factoring becomes trivial. Suppose a < b. Then gcd(a*b,floor(sqrt(a*b))!) = a, always. Factoring is the obstacle that keeps public key encryption systems safe.
In combinatorics, they need really huge factorial numbers to count things. In practice, it's acceptable to approximate them.
Stirling's approximation may be used, which is usually 1% accurate (first two digits are correct). There is also
Lanczos's approximation, which is an infinite series which can repeatedly be added for arbitrary precision.