Advertisement
jwrbg

EvenOrODD

Feb 14th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. package com;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class OddOrEven
  6. {
  7.   public static void main(String[] args)
  8.   {
  9.     Scanner scanner = new Scanner(System.in);
  10.     int inputNum = scanner.nextInt(); //if you work with too big numbers , it`s possible to try with another types
  11.  
  12.     boolean outPutResult = inputNum % 2 == 0;
  13.  
  14.     System.out.println(outPutResult ? "Number is even" : "Number is odd");
  15.  
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement