-
-
Save parzibyte/58e7cea4e306bf474fdf37f17083d93c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void productoDePares() { | |
Scanner sc = new Scanner(System.in); | |
int numero = 1; | |
int producto = 1; | |
while (numero != 0) { | |
System.out.println("Escribe un número (escribe 0 si quieres finalizar)"); | |
numero = sc.nextInt(); | |
if (numero != 0 && esPar(numero)) { | |
producto *= numero; | |
} | |
} | |
System.out.println("Producto de los números pares: " + producto); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment