C Program to Print Out Fibonacci Series Using Recursion

As Ih told you about Fibonacci Series in my previous post. Here I am writing the program to print Fibonacci Series Using Recursion. Recursion is a technique in which function call itself. A program that calls itself is called recursive program.

Look at the Program  ►►

int Fibonacci(int);
void main()
   int n, i = 0, c;
   printf("Enter the Number of Terms\n");
   printf("Fibonacci series up to %d are :\n",n);
   for ( c = 1 ; c <= n ; c++ )
      printf("%d\n", Fibonacci(i));
int Fibonacci(int n)
   if ( n == 0 )
      return 0;
   else if ( n == 1 )
      return 1;
      return ( Fibonacci(n-1) + Fibonacci(n-2) );

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s