#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x=-1,y=1,i;
cout<<"Enter the no. of terms you want to print ";
cin>>i;
for (int z=0;z<=i;z++)
{
z=x+y;
cout<<z<<"\n";
x=y;
y=z;
}
getch();
}
#include<conio.h>
void main()
{
clrscr();
int x=-1,y=1,i;
cout<<"Enter the no. of terms you want to print ";
cin>>i;
for (int z=0;z<=i;z++)
{
z=x+y;
cout<<z<<"\n";
x=y;
y=z;
}
getch();
}
No comments:
Post a Comment