Computer Science, asked by chandan731096, 6 months ago

rewrite the following using ternary operator
If (x%2==0)
System.out.println("even");
else
System.out.println("odd");

please answer correctly​​

Answers

Answered by anindyaadhikari13
3

Answer:-

Using ternary operator, we can write like this.

System.out.println((x%2==0)?"Even":"Odd");

Similar questions