Computer Science, asked by Sukritiraj, 9 months ago

rewrite the following using ternary operator-
if (X%2==0)
{
System.out.println("even no.");
}
else
{
System.out.println("odd no.");
}​

Answers

Answered by Anonymous
14

Answer:

System.out.ptintln(if(x%2==0)?even no.:odd no.);

Similar questions