You are viewing a single comment's thread. Return to all comments →
here is my snippet: class D : public A, public B, public C {
int val; public: //Initially val is 1 D() { val = 1; } //Implement this function void update_val(int new_val) { while( val < new_val) { if(new_val % (2*val)==0){ this->A::func(val); } else if(new_val % (3*val)==0) { this->B::func(val); } else if ( new_val %(5*val)==0) { this->C::func(val); } else { break; } } }
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Accessing Inherited Functions
You are viewing a single comment's thread. Return to all comments →
here is my snippet: class D : public A, public B, public C {