1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Eddi Din [679]
3 years ago
10

In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sid

es. Write a program that prompts the user to enter the lengths of three sides of a triangle and then outputs a message indicating whether the triangle is a right triangle. Assume the user does not know the hypotenuse. You may NOT ask the user for the hypotenuse. Meaning, you have to check all 3 sides to verify that it is a right-angled triangle.
Engineering
1 answer:
Dovator [93]3 years ago
8 0

Answer:

C++ code is explained below

Explanation:

/Remove the following line

//if not using visual studio.

#include "stdafx.h"

//Import the required header files.

#include <iostream>

using namespace std;

//Define the main function.

int main(void)

{

    //Define the variables.

    double side1, side2, side3;

    //Prompt the user to enter the sides of the triangle.

    cout << "Enter the side of the triangle:" << endl;

    cout << "Enter first side of triangle:" << endl;

    cin >> side1;

    cout << "Enter second side of triangle:" << endl;

    cin >> side2;

    cout << "Enter third side of triangle:" << endl;

    cin >> side3;

    cout << endl;

    //Check if the triangle sides are valid

    if ((side1 + side2 > side3) &&

         (side1 + side3 > side2) &&

         (side2 + side3 > side1))

    {

         //Check the condition for right angle triangle

         if ((side3*side3 == (side1*side1 + side2*side2)) ||

             (side2*side2 == (side3*side3 + side1*side1)) ||

             (side1*side1 == (side3*side3 + side2*side2)))

//Display that the triangle is right-angled triangle.

             cout << "It is a right-angled triangle." << endl;

         else

//Display that the triangle is not the right-//angled triangle.

             cout << "It is not a right-angled triangle."

<< endl;

    }

    else

         //Display not the valid side.

         cout << "Not a valid side." << endl;

    //Remove the following line if

    //not using visual studio.

    system("pause");

    return 0;

}

You might be interested in
What does it mean if a manufacturing company "retools"?
zmey [24]

Answer:

It mean to equip more tools.

Explanation:

I hope this helps.

6 0
3 years ago
Read 2 more answers
At a high school science fair, Connor won first place for his replica of the Golden Gate Bridge. Connor liked the project so muc
AnnZ [28]

Answer:

a

Explanation:

6 0
4 years ago
Multimeter and the LCD is showing Hz. What's she measuring?
eimsori [14]

Answer:

i think its d frequency

Explanation:

hz on a multimeter means frequency setting

6 0
3 years ago
You are driving on a roadway with multiple lanes of travel in the same direction, and are approaching an emergency vehicle parke
solmaris [256]

Answer: a. Leave the lane closest to the emergency as soon as it is safe to do so, or slow down to a speed of 20 MPH below the posted speed limit.

Explanation:

Giving a way to the law enforcement vehicle and a medical emergency vehicle is necessary. If one approaches an emergency vehicle parked along the roadway one should change the lane as the vehicle may not move and the driver may also waste his or her time also one should also slow down his or her speed while approaching the vehicle as most of the emergency vehicle are in rush to reach the hospital so the driver should maintain some distance with the medical emergency vehicle.

7 0
3 years ago
Two stepped bar is supported at both ends.At the join point of two segments,the force F is applied(downwards).Calculate reactive
nlexa [21]

Answer:

F=200kN

Explanation:

8 0
3 years ago
Other questions:
  • A measure of the probability, consequences, and exposure related to an event is referred to as a. safety b. evaluation c. risk d
    14·1 answer
  • A parallel plate capacitor has a separation of 2x10 m and free space between the plates. A 10 V battery is connected across the
    9·1 answer
  • Two synchronous motors having subtransient reactances of 0.8 and 0.25 p.u., respectively, on a base of 500 V 2 MVA are connected
    13·1 answer
  • What is 29.95 inHg in kPa?
    5·1 answer
  • What is planning in pretech
    6·1 answer
  • Steven is starting a project that requires a specialized, experienced contractor. Which selection process is the most suitable f
    11·1 answer
  • A wooden pallet carrying 540kg rests on a wooden floor. (a) a forklift driver decides to push it without lifting it.what force m
    8·1 answer
  • A semiconductor is a material that can carry an electric current between a ______and an insulator
    11·1 answer
  • Ethylene glycol, the ingredient in antifreeze, does not cause health problems because it is a clear liquid.
    6·1 answer
  • Blind spots around a large vehicle are _________________ than the blind spots around a car.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!