Fibonacci Series C Source Code
Fibonacci Series C Source Code
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.
How to Generate Fibonacci Series?
Mathematically, the nth term of the Fibonacci series can be represented as:
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….
Fibonacci Series Algorithm:
Start
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
-> show=a+b
-> a=b
-> b=show
-> increase value of i each time by 1
-> print the value of show
End
Fibonacci Series Flowchart:
Source Code in C Program for Fibonacci Series without using Function