Fibonacci series is defined as a sequence of numbers in which the first two numbers are 1 and 1, or 0 and 1, depending on the selected beginning point of the sequence, and each subsequent number is the sum of the previous two. So, in this series, the nth term is the sum of (n-1)th term and (n-2)th term. In this tutorial, we’re going to discuss a simple algorithm and flowchart for Fibonacci series along with a brief introduction to Fibonacci Series and some of its important properties.
Before taking you through the source code in Fibonacci Series Algorithm and Flowchart, first let me explain few things about this wonderful series, it’s mathematical derivation and properties. You can read more about Fibonacci series in our earlier post – C Program for Fibonacci Series, and here are other links to follow – Link 1. Link 2.
How to Generate Fibonacci Series?
tn = tn-1 + tn-2
The Fibonacci numbers upto certain term can be represented as: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144….. or 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144….
This the major property used in algorithm and flowchart for fibonacci series. The series starts with either 0 or 1 and the sum of every subsequent term is the sum of previous two terms as follows:
First Term = 0
Second term = 1
Third Term = First + Second = 0+1 =1
Fourth term = Second + Third =1+1 = 2
Fifth Term = Third + Fourth = 2+1 = 3
Sixth Term= Fourth + Fifth = 3+2 = 5
Seventh Term = Fifth + Sixth = 3+5 = 8
Eighth Term = Sixth + Seventh = 5+8 = 13 … and so on to infinity!
Fibonacci Series Algorithm:
- Declare variables i, a,b , show
- Initialize the variables, a=0, b=1, and show =0
- Enter the number of terms of Fibonacci series to be printed
- Print First two terms of series
- Use loop for the following steps
-> increase value of i each time by 1
-> print the value of show
Fibonacci Series Flowchart:
The algorithm and flowchart for Fibonacci series presented here can be used to write source code for printing Fibonacci sequence in standard form in any other high level programming language. If you have any queries regarding the algorithm or flowchart, discuss them in the comments section below.