Write a program to display the Fibonacci series

Write a program to display the Fibonacci series

Fibnacci series :
A series in which each element are the sum of previous two elements is known as Fibnocci series.

Example-
0 1 1 2 3 5 8 13 ................

program-

#include< stdio.h>
int main() {
int i,n=0,m=1,s;
printf("Fibonacci series:");
printf("0 1 ");
for(i=0;i< 10;i++)
{
s=n+m;
n=m;
m=s;
printf("%d ",s);
}
}


output-

Fibonacci series:
0 1 1 2 3 5 8 13 21 34 55 89




Read More →
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!