8. Rewrite the following using ternary operator.
(a) if (bill>10000)
discount=bill*10.0/100;
else
discount=bill*5.0/100;
Answers
Answered by
1
Answer:
discount =(bill>10000)?bill* 10.0/100:bill*5.0/100;. Explanation: when rewriting an if else snippet into ternary operator ,the ...
12 votes
Answer:discount =(bill>10000)?bill*10.0/100:bill*5.0/100;Explanation:when rewriting an if else snippet into ternary operator,the syntax is :variable
Similar questions