Advertisement
myrdok123

03. Even or Odd

Mar 16th, 2024
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. package ConditionalStatements;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P03EvenOrOdd {
  6.  
  7.  
  8.     public static void main(String[] args) {
  9.         Scanner scanner = new Scanner(System.in);
  10.  
  11.         int number = Integer.parseInt(scanner.nextLine());
  12.  
  13.         if(number % 2 == 0){
  14.             System.out.println("even");
  15.         }else {
  16.             System.out.println("odd");
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement