#include
#include
class
base
{
protected:
char name[20];
int age;
public:
void getdata()
{
cout<<"Enter
name:";
cin>>name;
cout<<"Enter
age:";
cin>>age;
}
};
class
student:public base
{
int marks;
public:
void get()
{
base::getdata();
cout<<"Enter
marks of student:";
cin>>marks;
}
void show()
{
cout<
}
};
class
employee:public base
{
long int salary;
public:
void get()
{
base::getdata();
cout<<"Enter
salary of employee:";
cin>>salary;
}
void show()
{
cout<
}
};
void
main()
{
clrscr();
student s;
s.get();
s.show();
employee e;
e.get();
e.show();
getch();
}
No comments:
Post a Comment