KnowledgeBoat Logo

Output Questions for Class 10 ICSE Computer Applications

Rewrite the following program segment using if-else statements instead of the ternary operator:

s = (a + b < c || a + c <= b || b + c <= a) ? "Triangle is not possible": "Triangle is possible";

Java

Java Operators

ICSE

43 Likes

Answer

if (a + b < c || a + c <= b || b + c <= a)
    s = "Triangle is not possible";
else
    s = "Triangle is possible";

Answered By

25 Likes