Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com;
- import java.util.Scanner;
- public class OddOrEven
- {
- public static void main(String[] args)
- {
- Scanner scanner = new Scanner(System.in);
- int inputNum = scanner.nextInt(); //if you work with too big numbers , it`s possible to try with another types
- boolean outPutResult = inputNum % 2 == 0;
- System.out.println(outPutResult ? "Number is even" : "Number is odd");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement