C++ Program Using Single Inheritance - Display The Personal Details & Residential Details Of A Person.
This is a sample program on Inheritance. Using Inheritance here we display the personal details and residential details of a person. #include <iostream.h> #include <conio.h> #include <stdio.h> class Person { private: int personid, age; char name[25]; public: void read1() { cout<<" Enter the name, id and age of the person "; gets (name); cin>>personid; cin>>age; } void print1() { cout<<'\n'<<'\n'<<" ******Details entered****** "<<'\n'; cout<<"Name: "<< name<<'\n'; cout<<"Age: "<<age<<'\n'; cout<<"Id: "<<personid<<'\n'<<'\n'<<'\n'; } }; class address: public Person { priv...