← Back to If Statements
Question 250
Right Triangle Check
Right Triangle Check
Three side lengths a, b and c are given in no particular order. They form a right triangle when the square of the longest side equals the sum of the squares of the other two. First use if statements to find the longest side (store it in a variable called longest) and the sum of the squares of the other two sides (in a variable called others), then printRight triangleorNot a right triangle.
Expected Output:
Right triangle= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.