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