#include<iostream> using namespace std; class B { public: B(int i) { x = i; cout << "Constructor of B" << endl; } ~B() { cout << "Destructor of B" << endl; } void show() { cout << "x=" << x << endl; } private: int x; }; class D :public B { public : D(int i, int j, int k) :B(j), d(k) { cout << "Constructor of D" << endl; } ~D() { cout << "Destructor of D" << endl; } void show1() { cout << "d=" <<endl; } private: B d; }; int main() { D obj(4, 5, 6); obj.show(); return 0; }