Explanatory Question
Rewrite the following using ternary operator:
if (x%2 == 0)
System.out.print("EVEN");
else
System.out.print("ODD");
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.