#include <iostream>
using namespace std;
class SingleInheritance{
public:
string name, gender;
int salary, age;
void getDetails(){
cin >> name >> gender >> age >> salary;
}
};
class inheritedclass:public SingleInheritance{
public:
void display(){
cout << "Name=" << name << "\nGender=" << gender << "\nAge=" << age << "\nSalary=" << salary << endl;
}
};
int main() {
inheritedclass tc;
tc.getDetails();
tc.display();
return 0;
}
using namespace std;
class SingleInheritance{
public:
string name, gender;
int salary, age;
void getDetails(){
cin >> name >> gender >> age >> salary;
}
};
class inheritedclass:public SingleInheritance{
public:
void display(){
cout << "Name=" << name << "\nGender=" << gender << "\nAge=" << age << "\nSalary=" << salary << endl;
}
};
int main() {
inheritedclass tc;
tc.getDetails();
tc.display();
return 0;
}
#include
ReplyDeleteusing namespace std;
class SingleInheritance{
public:
string name, gender;
int salary, age;
void getDetails(){
cin >> name >> gender >> age >> salary;
}
};
class inheritedclass:public SingleInheritance{
public:
void display(){
cout << "Name=" << name << "\nGender=" << gender << "\nAge=" << age << "\nSalary=" << salary << endl;
}
};
int main() {
inheritedclass tc;
tc.getDetails();
tc.display();
return 0;
}
Still it's evaluated 85% only
ReplyDeleteclass inheritedclass : public SingleInheritance
ReplyDeleteThis comment has been removed by the author.
ReplyDeletekis adhmare lund ka nateeja hai tu mr. Unknown
ReplyDeletesahi to hai code loudu
ReplyDelete