rewrite the following using ternary operator-
if (X%2==0)
{
System.out.println("even no.");
}
else
{
System.out.println("odd no.");
}
Answers
Answered by
14
Answer:
System.out.ptintln(if(x%2==0)?even no.:odd no.);
Similar questions