#include<iostream>
using namespace std;
class country
{
char name[30];
char capital[30];
char currency[30];
public:
void getDetails()
{
cout<<"\n\n...............................Enter country details................................";
cout<<"\nEnter the name of country:";
cin>>name;
cout<<"\nEnter the capital of country:";
cin>>capital;
cout<<"\nEnter the currency of country:";
cin>>currency;
}
void displayDetails()
{
cout<<"\n\n\n.............................Country Details:.................................."<<endl;
cout<<"Name:"<<name<<endl;
cout<<"Capital:"<<capital<<endl;
cout<<"Currency:"<<currency<<endl;
}
};
int main()
{
country c[30];
for(int i=0;i<4;i++)
{
c[i].getDetails();
}
for(int i=0;i<4;i++)
{
c[i].displayDetails();
}
return 0;
}
No comments:
Post a Comment