diff --git a/a.txt b/a.txt new file mode 100644 index 0000000..3c18775 --- /dev/null +++ b/a.txt @@ -0,0 +1 @@ +the first commit diff --git a/single_level_inheritance.cpp b/single_level_inheritance.cpp new file mode 100644 index 0000000..3cc3c1e --- /dev/null +++ b/single_level_inheritance.cpp @@ -0,0 +1,49 @@ +//single level inheritance i.e taking one as a parent class and another as a child class +//Dtyagi-9 +#include +using namespace std; +class A +{ + +public: + int a,b; + A(){ + a=0; + b=0; + }; + A(int p,int q) + { + a=p; + b=q; + } + void getdata() + { + cout<<"enter the values in a and b \n"; + cin>>a>>b; + + } + + +}; + +class B:public A +{ +public: + +void display() +{ + cout<<"THE VALUES OF A AND B ARE: \n a="<