Created
December 11, 2012 23:35
-
-
Save massimilianop7/4263389 to your computer and use it in GitHub Desktop.
Encontrar numero entre X y Y
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
function buscarDesdeHasta(desde,hasta,x) | |
{ | |
var arr = new Array(); | |
var longitud= hasta-desde+1; | |
for (var i=0; i<=longitud; i++) | |
{ | |
if (desde<=hasta) | |
{ | |
arr[i]=desde; | |
desde++; | |
}; | |
}; | |
for (var i = 0; i <= longitud; i++) | |
{ | |
if (arr[i]==x) | |
{ | |
return i; | |
}; | |
}; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment