galinyotsev123

ProgBasicsJavaBook3.1SimpleConditions03EvenOrOdd

Jan 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int number = Integer.parseInt(scanner.nextLine());
  8.  
  9. if (number % 2 == 0) {
  10. System.out.println("even");
  11. }
  12. else {
  13. System.out.println("odd");
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment