65 : C Program to display Fibonacci numbers between 1-100 using recurssion function

Check out the complete list of c-programs : C Program List    





In the previous program we have seem how to generate fibonacci series and what fibonacci number are.

In this program we displays fibonacci number sequences that occurs between 1-100 using recursion function.








/*
 * 1000+ C programs + tutorials
 *
 * 
 * 64_c_program_to_display_fibonacci_series_1_to_100_using_recursion_function.c
 *  
 *  
 *
 *  Created on: Oct 25, 2014
 *  Author: Code2care.org
 */

#include 
//#include 

void main() {


int fibo_func(int);

//clrscr();

int i;
int no;
 
 
   printf("C program to print Fibonacci series between 1-100 using recursion : ");
 
   for ( i = 0 ; i < 100 ; i++ )
   {
      if(fibo_func(i) > 100) {
          break;
      }
      printf("%d  ", fibo_func(i));
     
   }
 //	getch(); 

}
 
int fibo_func(int no)
{
   if ( no == 0 ) {
      return 0;
   }
   else if ( no == 1 ) {
      return 1;  
   }
   else {
       //Recursion
      return ( fibo_func(no - 1) + fibo_func(no - 2) );
   }
} 














The best way to learn C programming is to practice more and more of programs . Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.

BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.