Preview:
#include <iostream>
#include <cmath>

using namespace std;

int main() {
    double cote1, cote2, hypotenuse;
    bool respecteTheoreme;

    cout << "Entrez la valeur du premier côté : ";
    cin >> cote1;

    cout << "Entrez la valeur du deuxième côté : ";
    cin >> cote2;

    cout << "Entrez la valeur de l'hypoténuse : ";
    cin >> hypotenuse;


    respecteTheoreme = (fabs(cote1 * cote1 + cote2 * cote2 - hypotenuse * hypotenuse) < 0.1); // fabs donne la valeur abs 

    if (respecteTheoreme) {
        cout << "Respecte le théorème." << endl;
    } else {
        cout << "Ne respecte pas le théorème." << endl;
    }

    return 0;
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter