Tuesday, 7 January 2014

Print febonacci series upto 100

Fibonacci series program in C

Fibonacci series program in C; is very simple and easy to write, here i will show you how to write this program. The main concept of this series is add two previous number and get next number.


#include<stdio.h>
#include<conio.h>
void main()
{
double i,twoaway,next,current;
clrscr();
current=0;
next=1;
for(i=1;i<=100;i++)
{
printf(" %lf",current);
twoaway=next+current;
current=next;
next=twoaway;
}
getch();
}

Output

PRINT 100 FIBONOCII SERIES

No comments:

Post a Comment