diff --git a/CPP/questions/BasicInheritance.cpp b/CPP/questions/BasicInheritance.cpp new file mode 100644 index 00000000..3e461356 --- /dev/null +++ b/CPP/questions/BasicInheritance.cpp @@ -0,0 +1,48 @@ +//private inheritance +#include +using namespace std; +class person +{ + int id; + string name; + public: + void set_p() + { + cout<<"Enter id\n"; + cin>>id; + cout<<"Enter name\n"; + cin>>name; + //cout<>courseName; + cout<<"Enter fee\n"; + cin>>fee; + + } + void S_display() + { + display(); + cout<