#include <stdio.h>

int	ft_recursive_factorial(int nb)
{
	if (nb == 0)
		return (1);
	if (nb < 0)
		return (0);
	return (nb * ft_recursive_factorial(nb - 1));
}

int	main(void)
{
	int	nb;

	nb = 5;
	printf("Factorielle de : %d\n", nb);
	printf("Egal : %d\n", ft_recursive_factorial(nb));
	return (0);
}

Embed on website

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