Rewrite the following using ternary operator
if(x%2==0)
System.out.println("Even");
else
System.out.println("Odd”);
Answers
Answered by
5
Answer:
String k;
K = x%2==0? "Even" : "Odd" ;
System.out.print(k) ;
Similar questions