Fibonacci Series C Program

C Program To Print Fibonacci Series

Learn How To Print Fibonacci Series in C Programming Language. It is important that we should know How A For Loop Works before getting further with the C Program Code.

What is a Fibonacci Sequence?

A Fibonacci Sequence is a Sequence of Numbers in which the Next Number is found by Adding the Previous Two Consecutive Numbers.

Note: The First Two Digits in a Fibonacci Series is always 0 and 1.

A Fibonacci Series consists of First Digit as 0 and Second Digit as 1. The Next Digit (Third Element) is dependent upon the Two Preceding Elements (Digits). The Third Element so, the Sum of the Previous Two Digits. This addition of previous two digits continues till the Limit.

Example

0 1 1 2 3 5 8

Method 1: Print Fibonacci Series in C Programming using For Loop

Method 2: C Program To Generate Fibonacci Sequence using While Loop

Method 3: C Program To Print Fibonacci Sequence using Functions


Output

Learn How To Print Fibonacci Series in C Programming

There’s a trick with the Fibonacci Sequence. The Consecutive Terms in a Fibonacci Sequence can be made to Convert Miles to Kilometers. This has something to do with the Zeckendorf’s Theorem.

5 and 8 are consecutive terms in a Fibonacci Series.  Also, 5 Miles = 8 Kilometres. Similarly, 8 Miles = 13 Kilometres.

In case you get any compilation errors in the above Code To Print Fibonacci Sequence in C Programming using While Loop and For Loop or if you have any doubts about it, let us know about it in the Comment Section below.

Recommended Programs
C Program To Print Fibonacci Series using For Recursion
C Program To Calculate Sum of Digits of a Number
C Program To Find Narcissistic Number
Print A Christmas Tree in C Programming
C Program For Binary Search Algorithm using Functions
C Program To Find Magic Number
C Program To Multiply Two Numbers without Multiplication Operator
C Program To Convert Decimal To Octal Number
C Program For Travelling Salesman Problem
C Program To Count Trailing Zeros in an Integer using Loops
100+ C Programs For Programming Interviews

Tushar Soni

I am Tushar Soni, Co - Founder of CodingAlpha. I am a computer science student from India and passionate about Web Development and Programming. Connect with me on Facebook | LinkedIn | Google Plus

21 thoughts on “Fibonacci Series C Program

  • October 19, 2015 at 4:15 pm
    Permalink

    Excellent! Thanks!

    Reply
  • November 5, 2015 at 8:02 pm
    Permalink

    Thanks for multiple methods!

    Reply
    • July 31, 2016 at 7:18 pm
      Permalink

      You’re welcome Shanmukha. Our main reason to post multiple methids is to help the students understand the differences between them which will help then to clear basic concepts.

      Reply
  • November 28, 2015 at 8:02 pm
    Permalink

    Please provide Codes for Series programs in C.

    Reply
    • July 31, 2016 at 7:16 pm
      Permalink

      Its already there on our website. Make a search related to Sum of Series in C our Search bar.

      Reply
  • December 9, 2015 at 10:51 pm
    Permalink

    Best Program Updates. Thanks!

    Reply
    • July 31, 2016 at 7:20 pm
      Permalink

      You’re welcome. Find more updated C Programs on codingAlpha.

      Reply
  • August 20, 2016 at 11:37 pm
    Permalink

    Can we solve Fibonacci Series C Program using Recursion method?

    Reply
    • August 21, 2016 at 12:11 am
      Permalink

      Yes Akshay. Almost all the For Loops, While Loops can be converted into Recursion methods. You just need to understand Recursion properly.

      Reply
  • August 26, 2016 at 7:53 pm
    Permalink

    Is this a common interview question? My teachers told that it is frequently asked in interviews.

    Reply
    • September 5, 2016 at 12:16 pm
      Permalink

      It depends on the interviewer. But, you should understand the logic of Fibonacci Series. It is not that difficult.

      Reply
  • September 5, 2016 at 12:14 pm
    Permalink

    Thanks. You have made this logic for Fibonacci series quite simple to understand.

    Reply
  • September 13, 2016 at 10:26 pm
    Permalink

    Perfect code examples for Fibonacci Series in C. Thank you very much.

    Reply
  • September 15, 2016 at 12:17 pm
    Permalink

    When we have written this code
    first = second;
    second = third;
    count++;
    then why do we need to take the value of first and second as 1 and 0 at initialization in this fibonacci c program?

    Reply
  • October 6, 2016 at 7:16 pm
    Permalink

    Thanks for the fibonacci series logic. This is too good program!

    Reply
  • November 5, 2016 at 6:30 pm
    Permalink

    Instead of hard coding the first and second values of the fibonacci sequence, why not take the values from the user itself. Just in case he/she wants to begin the fibonacci sequence after a certain number, it would be much easier to code it in C language.

    Reply
  • November 5, 2016 at 6:55 pm
    Permalink

    Thanks for this. It is so nice of you to code and publish different methods for every given program. Keep it up.

    Reply
  • November 16, 2016 at 3:32 pm
    Permalink

    Nice explanation.

    Reply
  • November 22, 2016 at 3:54 am
    Permalink

    Nice code for Fibonacci sequence. So self explanatory.

    Reply

Join The Discussion