/* EXPERIMENT - */ /* AIM : TO GENERATE THE FIRST 'N' TERMS OF THE FIBONACI SERIES USING RECURSIVE FUNCTION */ /* PROGRAMMER : SHEKHAR A. SHERIKAR */ /* COMPUTER TECHNOLOGY - CM102 (B3) */ main() { long int x,a=3,b=1,c=2,o=0,v=0; clrscr(); printf("\n\t\tEnter the upper limit for the series : "); scanf("%d",&x); if((x>1)&&(x<3)) printf("\t1\t1\t"); if(x==1) printf("\t1\t"); if(x>2) { printf("\t1\t1\t2\t"); a=fibo(a,b,c,o,v,x); } printf("\n\t\tAND THE BET IS WON !!!!!!!!!"); getch(); } fibo(long int u,long int i,long int f,long int t,long int p,long int x) { p=i+f; printf("%d\t",p); i=f; f=p; u=u+1; t++; if(u>x-1) return(t); else fibo(u,i,f,t,p,x); }