Answers for "fibonacci series in c using recursion in data structure"

C
2

fibonacci series in c using recursion in data structure

#include<stdio.h>
int f(int);
int main()
{
int n, m= 0, i;
printf("Enter Total terms:n");
scanf("%d", &n);
printf("Fibonacci series terms are:n");
for(i = 1; i <= n; i++)
{
printf("%dn", fibonacci(m));
m++;
}
return 0;
}
int fibonacci(int n)
{
if(n == 0 || n == 1)
return n;
else
return(fibonacci(n-1) + fibonacci(n-2));
}
Posted by: Guest on January-10-2021

Code answers related to "fibonacci series in c using recursion in data structure"

Code answers related to "C"

Browse Popular Code Answers by Language