Function for the length of a hypotenuse.

May 20, 2012 at 8:40pm
I need help with this problem:

Write a function that will calculate the length of the hypotenuse of a right triangle. The function will take two real number parameters for the other two sides of the right triangle. The function will return the result it computes. Only write the function. you do not need to write main.

I have no idea what to do..
May 20, 2012 at 8:44pm
Do you know how to actually calculate the hypotenuse of a right triangle given the other two sides?
May 20, 2012 at 8:58pm
C++ already has that function, it's std::hypot() http://en.cppreference.com/w/cpp/numeric/math/hypot
Last edited on May 20, 2012 at 9:01pm
Topic archived. No new replies allowed.