Welcome to Home.

Saturday, December 6, 2014

Program in C To Print Fibonacci Series

#include<stdio.h>
#include<conio.h>
void main()
{
int a=0,b=1,c=0,n=0;
clrscr();
printf("Enter the Limits of Fibonacci Series\n");
scanf("%d",&n);
while(1)
{
printf("%d\n",c);
c=a+b;
a=b;
b=c;
if(c>n)break;
}
getch();
}

No comments:

Post a Comment