#include <stdio.h>

int	ft_iterative_factorial(int nb)
{
	int	result;

	result = 1;
	if (nb < 0)
		return (0);
	else if (nb <= 1)
		return (1);
	else
	{
		while (nb > 0)
		{
			result = result * nb;
			nb--;
		}
		return (result);
	}
}

int main(void)
{
    printf("%d", ft_iterative_factorial(6));
    return (0);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: