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