Write a program that prompts for and reads in the two side lengths of a right...

90.2K

Verified Solution

Question

Programming

Write a program that prompts for and reads in the two sidelengths of a right triangle (floating point numbers) and then callsa float-valued function, hypot1, that calculates and returns thelength of the hypotenuse of the triangle. The program then displaysthe two side lengths and the hypotenuse length.Note: The hypot1 functionreturns the hypotenuse length –it does not display it; the functionshould not contain any cout nor cin statements. Mathreview: Recall that for any right triangle with sidelengths a and b, and hypotenuse lengthc,a2+b2=c2.Here is an example of what output should look like from runningyour program (user input is shown inbold).  

Enter the side lengths: 1.2 3.4

First side length = 1.2

Second side length = 3.4

Hypotenuse length = 3.60555

Answer & Explanation Solved by verified expert
3.6 Ratings (518 Votes)
SOLUTIONI have solve the problem in C code with comments and    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students