Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Simple Conditions
- */
- import java.util.Scanner;
- public class _03b_EvenOrOdd
- {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- int num = Integer.parseInt(scan.nextLine());
- // Print the result using the ternary operator (?:)
- System.out.println((num % 2 == 0) ? "Even" : "Odd");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment