Rewrite using ternary operator:
if(x!=0)
System.out.println("Positive Number");
else
System.out.println("Negative Number");
Answers
Answered by
2
Answer:
if it is 0 the answer too 0
System.out.println is even
System.out.println is odd
Explanation:
if(num % 2 == 0) System.out.println(num + " is even"); else System.out.println(num + " is odd");
Similar questions