This Program Is An Example Of Multiple Inheritance In C++
Simply Copy And Paste This Code
Code:-
#include <iostream.h> #include <conio.h> class A { public: A(){ cout<<"Constructor of A class"<<endl; } }; class B { public: B(){ cout<<"Constructor of B class"<<endl; } }; class C: public A, public B { public: C(){ cout<<"Constructor of C class"<<endl; } }; void main() { //Creating object of class C C obj; getch(); }
OutPut
/*Output: Constructor of A class Constructor of B class Constructor of C class*/
Run This Program Using Turbo C++ in Pc Or TurboCdroid in Android It Will Work
#DigitaliseData
#C++Programing
0 Comments