Computer Science, asked by ashwin41566, 7 months ago

Write a java program to check the number 32 is an even or an odd number using
ternary Operator.​

Answers

Answered by 4264
0

Answer:

Scanner s = new Scanner(System. System. out. println("The given number "+n+" is Even ");

Answered by purveshKolhe
4

\huge{\purple{\underline{\underline{\mathfrak{\red{\bigstar answer:: \bigstar}}}}}}

public class Main {

  public static void main(String [] args) {

  String numType = (32 % 2 == 0) ? "Even number" : "Odd number";

  System.out.println(numType);

  }

}

\gray{\rule{300pt}{0.3em}}

\huge{\purple{\underline{\underline{\mathfrak{\red{\bigstar Syntax:: \bigstar}}}}}}

condition ? if true : if false;

\gray{\rule{300pt}{0.3em}}

Hope it helps..♪

Similar questions