Help me in multiple inheritance
Please help me in multiple inheritance in c++ with oop with examples please help me
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Feb 12, 2010, 11:25 AM EST
Here We Have Class A,B,C now Class C is derived from A and B so it shows multiple inheritance ..
now By Creating instance of Class C we can call All the mothods of class A,B as well as C too..
#include #include class A { public: int add(int a,int b) { return a+b; } }; class B { public: int substract(int a,int b) { return a-b; } }; class C:public A,public B { public : int multiply(int a,int b) { return a*b; } }; int main() { int a,b,c; C obj; cout"Enter Value of A:"; cin>>a; cout"Enyer Value of B:"; cin>>b; cout"Addition is :""Substration is :""Multiplication is :""PAUSE"); return 0; }