Guest User

Untitled

a guest
Aug 19th, 2019
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class InputValue {
  4. public static void main(String[] args) {
  5. //Declaración de Scanner
  6. Scanner sc = new Scanner(System.in);
  7.  
  8. System.out.print("Introduce un número: ");
  9. int number = sc.nextInt();
  10. if(number%2==0) {
  11. System.out.println("\t> " + number + " es par");
  12. } else {
  13. System.out.println("\t> " + number + " es impar");
  14. }
  15. sc.close();
  16. }
  17. }
RAW Paste Data