Computer Science, asked by nallarithvika, 6 months ago

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

Attachments:

Answers

Answered by swayam0610
1

Answer:

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

Explanation:

Hope it helps!!

Answered by jai696
4

\large\mathsf\color{pink}{Solution\: using\: Java}

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

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions