Skip to content

Instantly share code, notes, and snippets.

@hyst3ric41
Created June 23, 2018 01:48
Show Gist options
  • Save hyst3ric41/c3fcd43ec3a0a19469fc6372cb84de03 to your computer and use it in GitHub Desktop.
Save hyst3ric41/c3fcd43ec3a0a19469fc6372cb84de03 to your computer and use it in GitHub Desktop.
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