#include<stdio.h>
#include<conio.h>
void main()
{
int i,range;
int x=0,y=1,z;
printf("Enter the range:");
scanf("%d",&range);
printf("series:-");
printf("%d %d",x,y);
for(i=2;i<range;i++)
{
z=x+y;
x=y;
y=z;
printf(" %d",z);
}
}
#include<conio.h>
void main()
{
int i,range;
int x=0,y=1,z;
printf("Enter the range:");
scanf("%d",&range);
printf("series:-");
printf("%d %d",x,y);
for(i=2;i<range;i++)
{
z=x+y;
x=y;
y=z;
printf(" %d",z);
}
}
No comments :
Post a Comment