Advertisement
Codex

Odd or Even

Jul 27th, 2011
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1. import java.util.Scanner;
  2. class Number
  3. {
  4. public static void main(String args[])
  5. {
  6. Scanner sc=new Scanner(System.in);
  7. System.out.println("Enter a number");
  8. int num=sc.nextInt();
  9. if((num%2)==0)
  10. System.out.println("Even");
  11. else
  12. System.out.println("Odd");
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement