Rewrite the following using ternary operator.if(p>5000) d=p*5/100;else, double=p/5;
Answers
Answered by
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,
3 hours ago
Hindi,
6 hours ago
Social Sciences,
6 hours ago
Geography,
8 months ago
English,
8 months ago