← Back to If Statements
Question 237
Can It Be A Triangle
Can It Be A Triangle
Read three side lengths and decide whether they can form a triangle: they can only when the sum of every pair of sides is greater than the third side. Print Valid triangle or Not a triangle. Input: three lines, each a positive integer, no prompts. Output: one line. Join the three comparisons with and.
Expected Output:
Valid triangle= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
If StatementsOperators
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.