In a right triangle, the square of the length of one side is equal to the sum of
ID: 3646815 • Letter: I
Question
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 sides. Stephanie has the integer lengths of three sides of a triangle and needs to know if it is a right triangle. Write a program to solve this problem. NOTE: The user must be allowed to input the values of the sides in ANY ORDER!Explanation / Answer
#include using namespace std; int main(void) { double a; double b; double c; //INPUT cout > a; cout > b; cout > c; //CALCULATIONS if (((a * a) + (b * b) == (c * c)) || ((a * a) + (c * c) == (b * b)) || ((c * c) + (b * b) == (a * a))) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.