Write the following using ternary operator : [2]
if (x % 2 = = 0)
System.out.println (x + “is not multiple of 2”);
else
System.out.println (x + “is not a multiple of 2”);
Answers
Answered by
2
Answer:
System.out.println (x % 2 ==0? " multiple of 2":"not a multiple of 2" ) ;
Similar questions