Brock T.

asked • 03/08/22

Triangular Computation in C++

Triangle Computation

Concepts tested: Mathematical computation, formatting output

  

Write a program that:

 1) Reads in the length of 2 sides of a triangle as double (do NOT print out any prompts/instructions for the user)

 2) Computes the length of the 3rd side using the Pythagorean theorem (a^2 + b^2 = c^2, where a, b, and c, are the side lengths)

 3) Presents the length of the 3rd side with exactly 2 digits after the decimal point


 Example Input / Output:

  

 2.3658

 3.36954

 4.12



Code:


#include <iostream>
// OTHER INCLUSIONS
using namespace std;​

int main()
{
   //YOUR_CODE
}


1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.