3.C program to find Fibonacci series.
3.C program to find Fibonacci series.
Explaination:The Fibonacci series is a series of numbers where each number is the sum of the two numbers before it.
series Looks like this
0, 1, 1, 2, 3, 5, 8, 13, ...
This is the Core Logic so based on this we will write program now.
The first number is 0
The second number is 1
From the third number onward:
next = previous + one before previous
Steps:
Step:1
We use three variables:
first – holds first term (starts with 0)
second – holds second term (starts with 1)
next – stores the next term in the series
Step:2
Use a loop to calculate and print the next number by:
next = first + second
Step:3
Then update the values:
first = second
second = next
Done! Feeling great! 😄