#include <iostream>
using namespace std;
class Rectangle {
    public:
    int width;
    int height;
    int a;

Rectangle(int w,int h){
    width = w;
    height = h;
}

    void area(){
        cout << height * width <<endl;
    }
    void diagona(){
    int hw = (height * height) + (width * width);
        for (int i = 1; i <= hw; i++) {
            if (i * i == hw) {
                a = i;
                cout << a <<endl;
            }
        } 
    }
};
int main() {
Rectangle r(3,4);
    r.area();
    r.diagona();
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: