Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
479 B
1
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();
	}