WAP to display Fibonacci Series using Recursion
#include <stdio.h>
int fibonacci(int n)
{
if (n <= 1)
return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
int main()
{
int n, a = 0, b = 1, tmp;
printf("Enter N: ");
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
printf("%d ", fibonacci(i));
}
printf("\n");
return 0;
}