please type up code if possible write a program that prompts

please type up code if possible

write a program that prompts the user for the two legs of a right triangle and makes use of the pow and sqrt functions and the Pythagorean theorem to compute the length of the hypotenuse.

Solution

#include #include int main(void) { double Adjacent=2, Opposite=3, Hypotenuse=4; //Hypotenuse double Hypotenuse1 = (pow(Adjacent,2)) + (pow(Opposite,2)); Hypotenuse1=sqrt(Hypotenuse1); printf(\"\ Hypotenuse: %lf\",Hypotenuse1); //Adjacent double Adjacent1 = (pow(Hypotenuse,2)) - (pow(Opposite,2)) ; Adjacent1=sqrt(Adjacent1); printf(\"\ Adjacent: %lf\",Adjacent1); //Opposite double Opposite1 = (pow(Hypotenuse,2)) - (pow(Adjacent,2)); Opposite1=sqrt(Opposite1); printf(\"\ Opposite: %lf\",Opposite1); return 0; }
 please type up code if possible write a program that prompts the user for the two legs of a right triangle and makes use of the pow and sqrt functions and the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site