From 575c054c38dbd02cd9e14cb52335b07327b829ad Mon Sep 17 00:00:00 2001 From: Saksham Garg Date: Mon, 14 Dec 2020 16:45:54 +0530 Subject: [PATCH] Create inheritanceIntro-HR.cpp --- inheritanceIntro-HR.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 inheritanceIntro-HR.cpp diff --git a/inheritanceIntro-HR.cpp b/inheritanceIntro-HR.cpp new file mode 100644 index 0000000..8efc0c2 --- /dev/null +++ b/inheritanceIntro-HR.cpp @@ -0,0 +1,32 @@ +#include +#include +#include +#include +#include +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"; + } + void description(){ + cout<<"In an isosceles triangle two sides are equal\n"; + } +}; + +int main(){ + Isosceles isc; + isc.isosceles(); + isc.description(); + isc.triangle(); + return 0; +}