Subscribe to:
Post Comments (Atom)
CodeShikhi is the free learning platform, প্রোগ্রামিং,Learn Programming in Bangla,Bangla Programming Tutorial,C Programming in Bangla,C in Bangla,C Programming in Bengali,C Programming Bangla Tutorial, URI Online Judge Solution in C C++ Python,JavaScript Full Tutorials , OOP Tutorial in C++, Object Oriented Programming in C++,Learn OOP in C++,C Programming Exercises,C Programming Examples with Code
#include <stdio.h>
int main(){
int number, i = 0, Next, first = 0, second = 1;
printf("\n Please Enter the Range Number: ");
scanf("%d",&number);
while(i < number){
if(i <= 1){
Next = i;
}
else{
Next = first + second;
first = second;
second = Next;
}
printf("%d \t", Next);
i++;
}
return 0;
}
In the Fibonacci series, the next element will be the sum of the previous two elements. The Fibonacci sequence is a series of numbers where a number is found by adding up the two numbers before it. Starting with 0 and 1, the sequence goes 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so forth.
Written as a rule, the expression is Xn= Xn-1+ Xn-2
Previous Post:
0 Response to C Program to Find Fibonacci Series of a given Number | C Programming Examples
Post a Comment