Write the following statement using the conditional operator.

if (x > y)
z = (x + y) * 3;
else
z = x – 5 * y;

Using the conditional operator:

z = (x > y) ? (x + y) * 3 : x – 5 * y;