ProAnswers.org

Write a C program to find out the Fibonacci Series using Recursive Function?

#include

#include 

int fibo(int,int) 

int t1,t2,t3,count; 

void main() 

{ 

printf(“enter the number of terms

”);

scanf(“%d”,&n); 

t1=0; 

t2=1; 

printf(“%d	%d”,t1,t2); 

count=2; 

fibo(t1,t2); 

getch(); 

} 

int fibo(int t1,int t2) 

{ 

if(count>=n) 

return 0; 

else 

{ 

t3=t1+t2; 

printf(“	%d”,t3); 

count++; 

t1=t2; 

t2=t3; 

fibo(t1,t2); 

} 

} 

output: 

enter the number of terms 

5 

0 1 1 2 3