Computer Science, asked by alsoong3, 1 month ago

Rewrite the following using ternary operator:

if (bill>10000)
discount=bill*10.0/100;
else
discount=bill*5.0/100;​

Answers

Answered by kamalrajatjoshi94
0

Answer:

Given snippet:-

if (bill>10000)

discount=bill*10.0/100;

else

discount=bill*5.0/100;

Using ternary operator:-

discount=(bill>10000)?(bill*10.0/100):(bill*5.0/100.0);

Similar questions