#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,lim,a=0,b=1,c;
printf("Enter the limit:");
scanf("%d",&lim);
printf("%d,%d",a,b);
for(i=3;i<=lim;i++)
{
c = a+b;
a = b;
b = c;
printf(",%d",c);
}
getch();
}
#include<conio.h>
void main()
{
clrscr();
int i,lim,a=0,b=1,c;
printf("Enter the limit:");
scanf("%d",&lim);
printf("%d,%d",a,b);
for(i=3;i<=lim;i++)
{
c = a+b;
a = b;
b = c;
printf(",%d",c);
}
getch();
}
Comments
Post a Comment