Untitled
unknown
plain_text
a year ago
478 B
2
Indexable
Never
#include<iostream> using namespace std; class basic_info { protected:char name[15]; int age; }; class person: public basic_info { float h,w; public: void getdata() { cout<<"\n Enter name,age,height and weight: "; cin>>name>>age>>h>>w; } void show() { cout<<"\n name="<<name; cout<<"\n age="<<age; cout<<"\n height="<<h; cout<<"\n weight="<<w; } }; int main() { person p; p.getdata(); p.show(); }