Created
June 23, 2018 01:48
-
-
Save hyst3ric41/c3fcd43ec3a0a19469fc6372cb84de03 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class ejemplo4 { | |
final static byte[] n = { 4, 2, 5, 1, 6, 0, 6, 9, 5, 4, 5, 0 }; | |
static int numero_a_buscar = 1, i = 0; | |
static boolean encontrado = false; | |
public static void main(String[] args) { | |
while(encontrado==false){ | |
if(n[i]==numero_a_buscar){ | |
System.out.println("El número coincidio en la posición "+i+"."); | |
encontrado = true; | |
} | |
i++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment