Change this if else into ternary operators?
if (tax>100) tax=tax*0.1;
else tax=tax*0.2;
Answers
Answered by
0
Quite Simple
(tax>100?tax=tax*0.1:tax=tax=tax*0.2);
If the condition is true the tax contains tax=tax*0.1 else tax contains tax*0.2
Similar questions