Problem Statement - if-else to ternary conversion
Rewrite the following using ternary operator:
if (bill>10000)
discount=bill*10.0/100;
else
discount = bill*5.0/100;
Solution
sunmitra| Created: 25-Mar-2018 | Updated: 12-Apr-2019|ICSE2018
Rewrite the following using ternary operator:
if (bill>10000)
discount=bill*10.0/100;
else
discount = bill*5.0/100;
sunmitra| Created: 25-Mar-2018 | Updated: 12-Apr-2019|ICSE2018