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 Print PRIME Numbers in a Given Range
  • C Program to Calculate Sum of Even Values in an Array
  • C Program for Arithmetic Operations using Switch Statement
  • C Program to Implement SHELL SORT
  • C Program to CONCATENATE Two Strings using strcat()
  • Implementation of Queue using Array in C
  • C Program to Implement Structure with Pointers
  • C Program for Multiplication Table using Goto Statement
  • C Program to ADD two MATRICES
  • C Program to Find Area of a Square
  • Bubble Sort in C
  • Check a Character is Vowel or not Using C
  • C Program to Solve Tower of Hanoi Problem Using Recursive and Non-Recursive
  • C Program to Implement BINARY SEARCH
  • C Program to Find Factorial of a Number using While Loop
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top