#include
#include
class employee
{
char name[30];
float age;
public:
void getdata(void);
void putdata(void);
};
void employee::getdata(void)
{
cout<<"Enter name: "; cin>>name;
cout<<"Enter age: "; cin>>age;
}
void employee::putdata(void)
{
cout<<"Name: "<
const int size=3;
int main()
{
clrscr();
employee manager[size];
for(int i=0;i
cout<<"\nDetails of manager"< manager[i].getdata();
}
cout<<"\n";
for(i=0;i
cout<<"\nManager"< manager[i].putdata();
}
getch();
return 0;
}
Output:
Details of manager1
Enter name: BALAM
Enter age: 30
Details of manager2
Enter name: SABBIR AHMED
Enter age: 32
Details of manager3
Enter name: MD. OLIUR RAHAMAN
Enter age: 38
Manager1
Name: BALAM
Age: 30
Manager2
Name: SABBIR AHMED
Age: 32
Manager3
Name: MD. OLIUR RAHAMAN
Age: 38
No comments:
Post a Comment