Fibonacci Series Program in C

Prem Tiwari - - C Programming Tutorial

Sometimes back, one of my user our website is asked to create a program in c to get the Fibonacci series of any given number. Additionally, I have also shared a program to get the Fibonacci series of first 15 numbers without using the recursion.

What is Fibonacci Series

Fibonacci number is the number of any number in the series is obtained by adding previous two numbers of the series.

List of Fibonacci numbers

Below is the list of the first 21 Fibonacci series numbers Fn for n = 0, 1, 2, …, 20 are:

Fibonacci Series Program in C

How to get the fabonacci number of any given number

If you want to get the Fibonacci number of any input number by the user by using the Fibonacci series formula Fn-1 + Fn-2. Example if user enters number 9, then the Fibonacci number is 34. Below is the example of Fibonacci series in C programming by using recursion.

Output of above program is:

Another example of Fibonacci series is using dynamic programming.

Output of above program is:

Fibonacci Series in C Without Using Recursion

Output of above program is:

Prem Tiwari

Prem Tiwari is the founder of and also a professional developer and a blogger by hobby.

Tags: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.