Computer Science, asked by 1035smit, 11 months ago

Convert this to ternary operator :-
switch (n%2)
{
case 0: System.out.println ("Even");
break;
default : System.out.println ("Odd");
}

Answers

Answered by ksgjprasanna
1

Answer:

(n%2==0)?printf("Even"):printf("Odd");

Answered by mona7chinnu
1

Answer:b=(n%2 == 0)?"Even":"Odd"

Explanation:

Similar questions