Thursday, 23 July 2015

C Program - To print fibonacci series

C program to print fibonacci series 




#include<stdio.h>
#include<conio.h>
void main()
{
int a=0,b=1,c=0,i;
clrscr();
for(i=0;i<10;i++)
{
printf(" %d",c);
a=b;
b=c;
c=a+b;
}
getch();
}

Output :-


0 1 1 2 3 5 8 13 21 34

Back to 'C Language Program'

No comments:

Post a Comment