Saturday, November 7, 2009

Fibonacci Series | C Programming

//wap to print the fibbonacci series
#include
#include
void main()
{int i,a=0,b=1,c;
clrscr();
printf(“\n\n The fibonacci series : \n%d\n%d\n”,a,b);
for(i=1;i<=20;i++)
{
C=a+b;
Printf(“\n%d”,c);
A=b;
B=c;}
Getch();
}
o/p->
0 1 1 2 3 5 8 13 21 34 55



No comments:

Post a Comment