The length of the hypotenuse of a right-angled triangle is the square root of the sum of the squares of the other two sides. Write a function calcH that accept two doubles as function arguments and returns a double. Prompt the user for the length of base and the perpendicular side of the triangle. Use the pow and sqrt functions from cmath to perform the calculations.

Respuesta :

Answer:

# include<cmath>

# include <iostream>

# include<stdio.h>

using namespace::std;

int main()

{

   

   float a, b, c;

   cout<<"Enter a (Perpendicular)"; cin>>a;

   cout<<"Enter b (base)";cin>>b;

   c= sqrt(pow(a,2) + pow(b,2));

   cout<< "Hypotenuse="<<c;

   return 0;

}

Explanation:

Please check the answer section.

ACCESS MORE