Created
December 30, 2019 01:58
-
-
Save parzibyte/4128ffbf10f7af63712093bdb57a8d21 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
int otrosNumeros[] = {13, 12, 5, 12, 33, 1, 43}; | |
int menor = otrosNumeros[0];//Suponemos que el menor es el primero | |
// Ciclo comienza en 1 porque el 0 ya está contemplado | |
for (int x = 1; x < otrosNumeros.length; x++) { | |
int numeroActual = otrosNumeros[x]; | |
if (numeroActual < menor) { | |
menor = numeroActual; | |
} | |
} | |
System.out.printf("\nMenor: %d", menor); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment