You are viewing a single comment's thread. Return to all comments →
here's my solution and worked fine
class Rectangle{ protected: int width, height; public: Rectangle(int w, int h) :width(w), height(h){} virtual void display() const{ cout << width << ' ' << height<< endl; } }; class RectangleArea:public Rectangle{ public: RectangleArea():Rectangle(0,0){} void read_input(){ cin >> this->width >> this->height; } void display() const override{ cout << (this->width * this->height )<< endl; } };
Seems like cookies are disabled on this browser, please enable them to open this website
Rectangle Area
You are viewing a single comment's thread. Return to all comments →
here's my solution and worked fine