64 : C Program to display Fibonacci numbers between 1-100

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





C program that displays fibonacci number sequences that occurs between 1-100.

Fibonacci numbers or Fibonacci Series are integer number sequence.

First two numbers are 0 and 1, and every next number is an addition/sum of previous two numbers.

1st number => 0

2nd number => 1

3rd number => 1 (0+1)

4th number => 2 (1+1)

5th number => 3 (1+2)

6th number => 5 (2+3)

7th number => 8 (3+8)

........ and so on!










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

#include 
//#include 

void main() {


//clrscr();

 int first_no = 0;
 int second_no = 1;
 int next_no;
 int i;
 
 
   printf("C program prints 1st 1-100 Fibonacci series : ");
 
   for ( i = 0 ; i < 100 ; i++ )
   {
       
      if ( i <= 1 )
         next_no = i;
      else
      {
         next_no = first_no + second_no;
         first_no = second_no;
         second_no = next_no;
         
         if(next_no > 100) {
             break;
         }
      }
      printf("%d  ",next_no);
   }



//	getch();


}









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.