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