Shavit

Odd or Even

Oct 13th, 2013
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. // Shavit Borisov
  2. // CW
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class OddEven {
  7.  
  8.     public static void main(String[] args)
  9.    
  10.     {
  11.         Scanner in = new Scanner (System.in);
  12.        
  13.         int num;
  14.        
  15.         System.out.println("Enter a number:");
  16.             num = in.nextInt();
  17.        
  18.         if ((num % 2) == 0)
  19.         {
  20.             System.out.println("Your number is Even.");
  21.         }
  22.         else
  23.         {
  24.             System.out.println("Your number is odd.");
  25.         }
  26.        
  27.         in.close();
  28.     }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment