Q3A - getch(); } fibo(int a) { int m,c,f2; if(a==1) return...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<stdio.h> #include<conio.h> void main() { int x,n; int fibo(int n); clrscr(); printf("Enter the no n"); scanf("%d",&n); x=fibo(n); printf("The %dth number in a fibonacci series is %d",n,x);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: getch(); } fibo(int a) { int m,c,f2; if(a==1) return (0); else if(a==2) return (1); else { f2=fibo(a-2); m=fibo(a-1); c=f2+m; f2=m; printf("%d\n",c); return (c); } }...
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM1 taught by Professor Thakur during the Fall '06 term at University of Mumbai.

Ask a homework question - tutors are online