We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
class Triangle{
public:
void triangle(){
cout<<"I am a triangle\n";
}
};
class Isosceles : public Triangle{
public:
void isosceles(){
cout<<"I am an isosceles triangle\n";
}
};
class Equilateral : public Isosceles{
public:
void equilateral(){
cout<<"I am an equilateral triangle\n";
}
};
Multi Level Inheritance
You are viewing a single comment's thread. Return to all comments →
using namespace std;
class Triangle{ public: void triangle(){ cout<<"I am a triangle\n"; } };
class Isosceles : public Triangle{ public: void isosceles(){ cout<<"I am an isosceles triangle\n"; } }; class Equilateral : public Isosceles{ public: void equilateral(){ cout<<"I am an equilateral triangle\n"; } };
//Write your code here.
int main(){
}