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
3
Answer:-
Using ternary operator, we can write like this.
System.out.println((x%2==0)?"Even":"Odd");
Similar questions