fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3.  
  4. import java.util.*;
  5. import java.lang.*;
  6. import java.io.*;
  7.  
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. Scanner sc = new Scanner (System.in);
  15. double x = sc. nextDouble();
  16. if (x % 2 == 0)
  17. {
  18. System.out.println("This number is even.");
  19. }
  20. else
  21. {
  22. System.out.println("This number is odd.");
  23. }
  24. }
  25. }
Success #stdin #stdout 0.2s 55928KB
stdin
6
stdout
This number is even.