Search This Blog

Translate

C Program to display Fibonacci series


C Program to display Fibonacci series,

C Program to display Fibonacci series using recursion,

C Program to display Fibonacci series using function, 

C Program to display Fibonacci series using pointers

C Program to display Fibonacci series

 
#include
#include
main()
{
int a=0,b=1,c,i,n;
clrscr();
printf("enter the limit of series\n");
scanf("%d",&n);
if(n==0)
printf("%d\n",a);
else
printf("%d\n%d\n",a,b);
for(i=2;i<=n;i++)
{
c=a+b;
printf("%d\n",c);
a=b;
b=c;
}
getch();
}

C Program example List

Google+ Badge