Mega Code Archive
Use the Pythagorean theorem to find find the length of the hypotenuse
#include
#include
using namespace std;
int main() {
double x, y, z;
x = 5;
y = 4;
z = sqrt(x*x + y*y);
cout << "Hypotenuse is " << z;
return 0;
}
Hypotenuse is 6.40312"