Printing Fibonacci Series [ C Program Code]


This C Program code prints the Fibonacci series.


#include<stdio.h>
int main()
{
int a=0,b=1,c=1,n;
printf("Enter the limit: ");
scanf("%d",&n);
printf("%d",a);
while(b<n)
{
printf("\n%d",c);
c=a+b;
a=b;
b=c;
}
getch();
return(0);
}
view raw gistfile1.txt hosted with ❤ by GitHub

Comments