Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
884
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.sql.SQLOutput;
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7.  
  8. public static void main(String[] args) {
  9. Scanner scanner = new Scanner(System.in);
  10.  
  11. int n = Integer.parseInt(scanner.nextLine());
  12. while (n%2!=0){
  13. System.out.println("Please write an even number.");
  14. n = scanner.nextInt();
  15. }
  16. System.out.printf("The number is: %d",Math.abs(n));
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement