You are on page 1of 1

/* C Program to demonstrate fibonacci series */

#include<stdio.h>
main()
{
int a,b,c,d;
a=0;
b=1;
clrscr();
printf("Enter the number of terms");
scanf("%d",&d);
while(d>=1)
{
c=a+b;
a=b;
b=c;
d=d-1;
printf("%d \n",c);
}
getch();
}

You might also like