#include<stdio.h>
void fib(int);
main()
{
int z;
printf("Enter the limit\n");
scanf("%d",&z);
printf("Fibonacci sequence\n");
fib(z);
}
void fib(int z)
{
static int a,b;
int c;
if(z<2)
{
a=0;
b=1;
}
else
{
fib(z-1);
c=b;
b=a+b;
a=c;
}
printf("\n%d",a);
}
You Like It!? Then kindly share with your Friends.