Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class EvenNumber {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n;
- while ((n = Integer.parseInt(scanner.nextLine())) % 2 != 0) {
- System.out.println("Please write an even number.");
- }
- System.out.printf("The number is: %d\n", Math.abs(n));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement