Advertisements
Advertisements
प्रश्न
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";
संक्षेप में उत्तर
उत्तर
String s;
if ((a + b < c || a + c <= b || b + c <= a)
s = "Triangle is not possible";
else
s = "Triangle is possible";
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.04: Operators in Java - EXERCISES [पृष्ठ ४४]