Skip to content

Commit

Permalink
Create inheritanceIntro-HR.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
saksham101 authored Dec 14, 2020
1 parent bfd2417 commit 575c054
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions inheritanceIntro-HR.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#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";
}
void description(){
cout<<"In an isosceles triangle two sides are equal\n";
}
};

int main(){
Isosceles isc;
isc.isosceles();
isc.description();
isc.triangle();
return 0;
}

0 comments on commit 575c054

Please sign in to comment.