Print Fibonacci series in C by R4R Team

Fibonacci series :
A series in which each element are the sum of previous two elements is known as Fibonacci 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:\n");
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




Leave a Comment:
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!