#include
main()
{int fibo(int n);
int fib, n;
clrscr();
printf("\n\nFibonacci Series:");
printf("\nEnter the number of term to show");
scanf("%d", &n);
fib=fibo(n);
printf("The number is %d", fib);
getch();
return(0);}
int fibo(int n)
{if(n==1n==2)
{return(1);}
else{return fibo(n-1)+fibo(n-2);}}
It's such a weird hour to blog... i slept in the evening...
No comments:
Post a Comment