programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program for Fibonacci Series Using for Loop

Details
Written by: Rama Boya
Category: C Programs
#include<stdio.h>
#include<conio.h>

int main ()
{

  int first = 0, second = 1, third, i, n;

  printf ("Enter the length of the fibonacci series \n");

  scanf ("%d", &n);

  printf ("The Fibonacci series is :\n");

  printf ("%d%d", first, second);

  for (i = 2; i <= n; i++)

    {

      third = first + second;

      printf ("%d ", third);

      first = second;

      second = third;

    }

  return 0;

}

 OUTPUT:

Enter the length of the fibonacci series                                                                                               
10                                                                                                                                    
The Fibonacci series is :                                                                                                              
011 2 3 5 8 13 21 34 55   
Previous article: C Program for Circumference of a Circle Prev Next article: C Program to Print Pascal Traingle Next
  • C Program to Check Given Number is PRIME or Not
  • C Program to find Size of Integer
  • C Program to Calculate Sum of Even Values in an Array
  • C Program to Find Biggest among Three Numbers
  • C Program to Find Address locations of Array Elements Using Pointers
  • C Program to Find Address Locations of Variables
  • C Program to INSERT a Sub-String in Main String at Given Position
  • C Program to Print Elements of Array Using Pointers
  • C Program to Implement Structure with Pointers
  • C Program for String Concatenation without using strcat()
  • C Program for Call By Reference
  • C Program for Sum of Digits of a Number using Recursion
  • C Program to Find Area of Rectangle
  • Finding GCD and LCM of Given Numbers using C
  • C Program to find an Element using Binary Search
  • Privacy Policy
  • Cookie Policy
© programming9.com 2026
Back to top