# Hacker Rank solution for Multi Level Inheritance In C++

Problem:- Multi Level Inheritance Hacker Rank Solution or Multi Level Inheritance hacker rank solution c++ orMulti Level Inheritance in java or Multi Level Inheritance solution or Multi Level Inheritance solution in C++ or Multi Level Inheritance hacker rank solution in Java or Multi Level Inheritance hacker rank solution c++ or Multi Level Inheritance hacker rank solution c++ or Multi Level Inheritance program in c or Multi Level Inheritance solution in C or Hacker Rank Solution For Multi Level Inheritance in C++ or Multi Level Inheritance in C++ or Hacker Rank solution for Multi Level Inheritance in C++.

Explanation:- Suppose we have a class A which is the base class and we have a class B which is derived from class A and we have a class C which is derived from class B, we can access the functions of both class A and class B by creating an object for class C. This is called Multi-Level inheritance. (B inherits A and C inherits B.)

Check- Geeksforgeeks solution for School, Basic, Easy, Medium, Hard Domain.

Copy the full solution or colored code and paste into the hacker rank editor and click to Run Code if the code runs successfully then click to Submit Code. Before pasting the code into the editor make sure you have chosen c++ editor in the top right drop down option.

Submit your solution here:- Click here

Solution:-

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
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";
}
};

int main()
{

Equilateral eqr;

eqr.equilateral();

eqr.isosceles();

eqr.triangle();

return 0;

}

Output:-

#### Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed