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