#include <stdio.h>
#include <conio.h>
int fibn(int n)
{
int a, b, c;
if(n==1 || n==2)
return(n-1);
a=fibn(n-1);
b=fibn(n-2);
c=a+b;
return c;
}
int main()
{
int fib, i;
printf("Enter ending number where fibanoci series ends: ");
scanf("%d", &fib);
for(i=1; i<=fib; i++)
{
printf("Fibnocii of %d is %d.\n", i, fibn(i));
}
getch();
}
#include <conio.h>
int fibn(int n)
{
int a, b, c;
if(n==1 || n==2)
return(n-1);
a=fibn(n-1);
b=fibn(n-2);
c=a+b;
return c;
}
int main()
{
int fib, i;
printf("Enter ending number where fibanoci series ends: ");
scanf("%d", &fib);
for(i=1; i<=fib; i++)
{
printf("Fibnocii of %d is %d.\n", i, fibn(i));
}
getch();
}