16.0k views
3 votes
Write an algorithm for a program which inputs the lengths a, b and c of the three

sides of a triangle. The program then determines whether the triangle is right-angled
and prints out a message to say whether or not the triangle is right angled. You may assume that a is the longest side. The triangle is right-angled if a2 = b2 + c2

I’m really stuck with this and need help asap

2 Answers

7 votes

Answer:

Triangles algorithm

IF a^2 == b^2 + c^2

then display is to the right

IF it is anything else then display not to the right.

User Nicero
by
3.5k points
13 votes

Hello,

Answer:

--//Triangles Algorithm

Declare the variables of the side of each triangle, in this case, a, b, and c, and input them.

If a^2 == b^2 + c^2

display "This triangle IS right-angled."

Else

display "This triangle is NOT right-angled

Step-by-step explanation:

The meaning of the word "algorithm" in this situation would be the coding of the program that you are assigned to create. I'll use Python in this. Display, in this case, will mean "print"

User Fayth
by
3.1k points