Computer Science, asked by sksozosos098, 6 hours ago

Rewrite the following using ternary operator.if(p>5000) d=p*5/100;else, double=p/5;​

Answers

Answered by mpd20700
1

Answer:

With if-else:

if (p > 5000)

{

     d=p*5/100;

}

else

{

     double=p/5;

}

With Ternary Operator:

d = (p > 5000)?p*5/100:p/5;

Similar questions
Math, 8 months ago