Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
583 B
2
Indexable
Never
#include<iostream>
using namespace std;
class top
{
	public:
		int a;
		void getdata()
{
	cout<<"\n\nenetr first number :::\t";
	cin>>a;
	}
	void putdata()
	{
		cout<<"\nfirst number is :::\t"<<a;
	}
	};
	class middle :public top
	{
		public:
			int b;
			void square()
			{
				getdata();
				b=a*a;
				cout<<"\n\nsquareis :::"<<b;
			}
			};
			class bottom :public middle
			{
				public:
					int c;
					void cube()
			{
				square();
				c=b*a;
				cout<<"\n\ncube :::\t"<<c;
				
			}
	};
	int main()
	{
		bottom b1;
		b1.cube();
	}