write in ternary operator if(x%2==0) system.out.println("even"); else system.out.println("odd");
Answers
Answered by
0
Simple:
System.out.println(x % 2 == 0 ? "even" : "odd");
Hope this helps!
Similar questions