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";
Related Questions
Rewrite the following program segment using if-else statements instead of the ternary operator:
commission = (sale > 5000) ? sale*10/100 : 0;
Rewrite the following program segment using if-else statements instead of the ternary operator:
net = (salary > 10000) ? salary - (8.33/100)*salary : salary - (5/100)*salary
Rewrite the following using ternary operator:
if (x % 2 == 0) System.out.println("Even"); else System.out.println("Odd");
Rewrite the following program segment using if-else statements instead of the ternary operator:
c = (x >= 'A' && x<= 'Z') ? "Upper Case Letter" : "Lower Case Letter";