#include <stdio.h>

int	ft_fibonacci(int index)
{
	if (index < 0)
		return (-1);
	else if (index == 0)
		return (0);
	else if (index == 1)
		return (1);
	return (ft_fibonacci(index - 1) + ft_fibonacci(index - 2));
}

int	main(void)
{
	int	index;

	index = 18;
	printf("Fibonacci de : %d", index);
	printf(" : %d\n", ft_fibonacci(index));
	return (0);
}

Embed on website

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