par
Riki Mondal , Full Stack Debeloper , National Institute of Technology Durgapur
#include<stdio.h>
int fib(int n)
{
if (n <= 1)
return n;
return fib(n-1) + fib(n-2);
}
int main ()
{
int n = 9;
printf("%d", fib(n));
getchar();
return 0;
}
/* Fibonacci Series c language */#include<stdio.h>int main(){int n, first =0, second =1, next, c;printf("Enter the number of terms\\n");scanf("%d",&n);printf("First %d terms of Fibonacci series are :-\\n",n);for( c =0; c < n ; c++){if( c <=1)
next = c;else{
next = first + second;
first = second;
second = next;}printf("%d\\n",next);}return0;}