Question bank › Math
Dsa Math Medium

Valid Triangle Check

Write a program that checks if three sides can form a valid triangle. The sides are provided as positive integers. Print 'YES' if they can form a triangle, otherwise print 'NO'. ### Input Format: Three positive integers a, b, c (1 <= a, b, c <= 10^6). ### Output Format: A single string either 'YES' or 'NO'. ### Example: Input: 3 4 5 Output: YES ### Explanation: The triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than the length of the third side.

Key concepts

mathgeometryvalidation

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.