Home / Questions / Rewrite the following program segment using the if..else statement: comm = (sale > 15000)? sale * 5 / 100 : 0;
Explanatory Question

Rewrite the following program segment using the if..else statement:

comm = (sale > 15000)? sale * 5 / 100 : 0;

👁 70 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation


if(sale > 15000)
    comm = sale * 5 / 100;
else
    comm = 0;