English, asked by esha69462, 7 months ago

# include <iostream > using namespace std; class mybase { int a, b; public : int c; void setab (int i, int j) { a = i; b = j; } void getab (int &i, int &j) { i = a; j = b; } }; class derived1 : public mybase { // ... }; class derived2 : private mybase { }; int main () { derived1 o1; derived2 o2; int i, j; // ... } Within main(), which of the following statements are legal? A. o1. getab (i, j); B. o2. getab (i, j); C. o1.c = 10; D. o2.c = 10; complete this problem with constructor, destrutor and all possible methods. in this program constructor has no argument.​

Answers

Answered by Rupma
1

Answer :

using namespace std;

class Base1 {

public:

Base1()

{ cout << " Base1's constructor called" << endl; }

};

class Base2 {

public:

Base2()

{ cout << "Base2's constructor called" << endl; }

};

class Derived: public Base1, public Base2 {

public:

Derived()

{ cout << "Derived's constructor called" << endl; }

};

int main()

{

Derived d;

return 0

Similar questions