Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shavit Borisov
- // CW
- import java.util.Scanner;
- public class OddEven {
- public static void main(String[] args)
- {
- Scanner in = new Scanner (System.in);
- int num;
- System.out.println("Enter a number:");
- num = in.nextInt();
- if ((num % 2) == 0)
- {
- System.out.println("Your number is Even.");
- }
- else
- {
- System.out.println("Your number is odd.");
- }
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment