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