Advertisement
tchenkov

L03u03_EvenOrOdd

Jan 18th, 2017
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /*
  4.  * Created by todor on 17.01.2017 г..
  5.  */
  6. public class u03_EvenOrOdd {
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scan = new Scanner(System.in);
  10.  
  11.         int num = Integer.parseInt(scan.nextLine());
  12.  
  13.         boolean isEven = num % 2 == 0;
  14.  
  15.         if (isEven){
  16.             System.out.println("even");
  17.         }
  18.         else {
  19.             System.out.println("odd");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement