Computer Science, asked by alkaanshi17, 2 months ago

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 Omkarborde100
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