aitía
Coder
My factorial program does not give me the correct results in cases, for instance 13 should be 6227020800 and my output is 1932053504. I display my C program below, is someone able to help me fix it for these cases? I know the formula for factorial is n × (n - 1).
C:
int factorial(int nb)
{
int res;
res = 1;
if (nb == 0 || nb == 1)
return (1);
while (nb > 1)
res *= nb--;
return (res);
}