Write a java program to check the number 32 is an even or an odd number using
ternary Operator.
Answers
Answered by
0
Answer:
Scanner s = new Scanner(System. System. out. println("The given number "+n+" is Even ");
Answered by
4
public class Main {
public static void main(String [] args) {
String numType = (32 % 2 == 0) ? "Even number" : "Odd number";
System.out.println(numType);
}
}
condition ? if true : if false;
Hope it helps..♪
Similar questions