Single Inheritance – Public Inheritance in C++

Inheritance in which the derived class is derived from only one base class is called single inheritance. Let us consider a simple example to illustrate the single inheritance. Program given below shows a base class B and a derived class D. The class B contains one private data member, one public data member and three public member functions. The class D contains one private data member and two public member functions. #include<iostream.h> class B { private: int a; //private; not inheritable public: int b; //public; ready for inheritance void get_ab(); int get_a(); void show_a(); }; class D : public B //public derivation { private: int c; public: void mul(); void display(); }; /*…Defining of functions…*/ void B :: get_ab() { a = 5; b = 10; } int B :: get_a() { return a; } void B :: show_a() { cout << “a = ” << a <<endl; } void...