#include<iostream.h>
void main()
{
char choice;
do
{
long double num, a=1, b=0, count;
cout<<"ENTER THE NUMBER OF ELEMENTS REQUIRED : ";
cin>>num;
cout<<"\n\n";
for(count=1; count<=num/2;count++)
{
a+=b;
cout<<b << "\t";
b+=a;
cout<<a << "\t";
}
cin>>choice;
}while(choice=='x'||choice=='x');
}
No comments:
Post a Comment