Computer Science, asked by dharmaveerasari, 3 months ago

Rewrite the following using ternary operator
if(x%2==0)
System.out.println("Even");
else
System.out.println("Odd”);​

Answers

Answered by aritrika7
5

Answer:

String k;

K = x%2==0? "Even" : "Odd" ;

System.out.print(k) ;

Similar questions