Rectangle Area

  • + 1 comment

    C++ 14

     class Rectangle{
         public:
         int w,h;
         void display(){
             cout<<w<<" "<<h<<endl;
         }
     };
     
     class RectangleArea : public Rectangle{
         public:
         void read_input(){
             cin >> w;
             cin >> h;
         }
         void display(){
             cout<<w*h;
         }
     };