Computer Science, asked by amanpreet171717, 1 year ago

write in ternary operator if(x%2==0) system.out.println("even"); else system.out.println("odd");​

Answers

Answered by CoolorFoolSRS
0

Simple:

System.out.println(x % 2 == 0 ? "even" : "odd");

Hope this helps!

Similar questions