-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.java
43 lines (43 loc) · 1.75 KB
/
main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
6. Escribir un programa que pida un número al usuario e
indique mediante un literal booleano si el número es par.
@author Daw120
*/
package com.solomongo.ejercicio6_daw120;
import java.util.Scanner;
public class Ejercicio6_DAW120 {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
int numero;
System.out.print( "\nEscribe un numero: " );
numero=teclado.nextInt();
boolean total;
total = numero % 2 == 0;
String total2;
total2 = total==true? " par": " impar";
System.out.print("El numero "+numero+" es ");
System.out.print(total2+" ("+total+ ").\n");
}
}
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@BGGGGGGGGGGGGGGGGBBB#&@@@@@@@@@@@@@@@@@@@
@@@@@@@@@B .~Y&@@@@@@@@@@@@@@@
@@@@@@@@@@&: ^G@@@@@@@@@@@@@
@@@@@@@@@@@@7.:::::::::::::. ~&@@@@@@@@@@@
@@@@@@@@@@@@@@@B?JJJJJP@@@@@@#? .&@@@@@@@@@@
@@@@@@@@@@@@@@@J .@@@@@@@@&: !@@@@@@@@@@
@@@@@@@@@@@@@@@J :@@@@@@@@@# &@@@@@@@@@
@@@@@@@@@@@@@@@J :@@@@@@@@@@ &@@@@@@@@@
@@@@@@@@@@@@@@@J :@@@@@@@@@P .@@@@@@@@@@
@@@@@@@@@@@@@@@J :@@@@@@@@P Y@@@@@@@@@@
@@@@@@@@@@@@@@@J .&&&&#GJ: 7@@@@@@@@@@@
@@@@@@@@@@@@@@@J 5@@@@@@@@@@@@
@@@@@@@@@@@@@@@J :Y&@@@@@@@@@@@@@
@@@@@@@@@@@@@@@Y ..^7P&@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/