โ Back to Functions
Question 402
Hypotenuse Function
Hypotenuse Function
Write a functiondouble hypotenuse(double a, double b)that returns the hypotenuse length usingsqrt(a*a + b*b). Call it withhypotenuse(3, 4)and print the result with exactly 2 decimal places: 5.00 Include<cmath>forsqrt.
Expected Output:
5.00
Topics:
Functions
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.