Computer Applications

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

commission = (sale > 5000) ? sale*10/100 : 0;

Java

Java Operators

86 Likes

Answer

if (sale > 5000)
    commission = sale * 10 / 100;
else
    commission = 0;

Answered By

51 Likes


Related Questions