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
  • Page Replacement Programs in C
  • C Program for Monthly Bill of a Newspaper
  • C Program to Find Largest Element in an Array
  • C Program to Solve Sum of Series 1-x2/2! +x4/4!-x6/6!+x8/8!-x10/10!
  • C Program to Evaluate POSTFIX Expression Using Stack
  • C Program to Find Roots of a Quadratic Equation
  • C Program to Find Area of a Square
  • C Program to Delete Characters from Given String
  • C Program to Check Given Number is PRIME or Not
  • Check a Character is Vowel or not Using C
  • C Program to Find Length of a String Using STRLEN()
  • C Program for Matrix Multiplication
  • C Program to Implement Circular Linked List
  • C Program to Find Factorial of a Number using Recursion
  • Finding GCD and LCM of Given Numbers using C
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top