Fibonacci Series Program In C

           Fibonacci Series 



#include<stdio.h>
#include<conio.h>
Void main()
{
Int a,b,c,n,i;
Clrscr();
Print("enter the limit=");
Scanf("%d",&n);
a=0;b=1;
For(i=1;i<=n;i++)
{
Print("%d",a);
C=a+b;
a=b;
b=c;
}
getch();
}
Output
             Enter the limit=5
                         0
                         1
                         1
                         2
                         3
                      



Comments

Post a Comment