C and C++ programs and MySQL
Always thinking in engineering style...
Sunday, August 23, 2009
Fibonacci series
This program prints the Fibonacci series
#include
#include
void main(void)
{
int i,j,k,n;
clrscr();
i=0;
j=1;
printf("%d %d ",i,j);
for(n=0;n<=5;n++)
{
k=i+j;
i=j;
j=k;
printf("%d ",k);
}
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment