Finding hypotenuse of a right angled triangle – CSKC
Sign In

Search

Solved Problem #CPP#5328    siteicon   siteicon  

Problem Statement - Finding hypotenuse of a right angled triangle

Write a program to print hypotenuse of a right angled triangle if base and height of the triangle is given by the user.

Solution

TC++ #5328

 

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test CPP

Notes

  • some student use the pow() function also to calculate squares of base and height also. They write above as -hyp = sqrt(pow(bs,2)+pow(ht,2)) ;This is okay but less efficient and sometime less precise also.  pow() function is recommended for power of more than 3 and/or power in terms of fractions.


Share

Created: 8-Dec-2018 21:33 | Updated: 8-Dec-2018 21:55|