Although no C function is written particularly for computing factorials, the C math package allows you to compute the gamma function. Because (n) Equals (n-1)!
Using tgamma of i+1 on positive integers returns i!.
for (int i = 1 ; i != 10 ; i++) {
printf("%lld %f\n", factorial(i), tgamma(i+1));
}
Demo.
1 1.000000
2 2.000000
6 6.000000
24 24.000000
120 120.000000
720 720.000000
5040 5040.000000
40320 40320.000000
362880 362880.000000