Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- class square
- {
- public:
- int a=3;
- square()
- {
- a=a*a;
- cout << "Square is: " << a << endl;
- }
- };
- class cube : public square
- {
- public:
- int a=3;
- cube()
- {
- a=a*a*a;
- cout << "Cube is: " << a << endl;
- }
- };
- class number : public cube
- {
- };
- int main()
- {
- number obj;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement