#include <stdio.h>
int ft_iterative_factorial(int nb)
{
int i;
unsigned long long r;
i = 2;
r = 1;
if (nb < 0)
return 0;
if (nb <= 1)
return 1;
while (i <= nb)
{
r *= i;
i++;
}
return r;
}
int main()
{
printf("%d", ft_iterative_factorial(0));
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: