#include <stdio.h> #include <conio.h> int y; fib(int n) { if(n==1 || n==0) return n; y=fib(n-1)+fib(n-2); return y; } int main() { int a,r; clrscr(); printf("Enter any number : "); scanf("%d",&a); r=fib(a); printf("The no. at position %d is %d",a,r); getch(); return 0; }
No comments:
Post a Comment