-
-
Save hawkapparel/ec0729f157d597643cdfa63c9bbcf2d4 to your computer and use it in GitHub Desktop.
Calculadora de cuadrados
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
function checkLong(n, m, a, b, l){ | |
console.log("entro a la function"); | |
if( l*n < a){ | |
console.log("entro a l*n es menor a A"); | |
n++; | |
console.log(n); | |
checkLong(n, m, a, b, l); | |
}else{ | |
console.log("entro a l*n es mayor a A"); | |
if( l*m < b){ | |
console.log(n); | |
m++; | |
console.log(m); | |
checkLong(n, m, a, b, l); | |
}else{ | |
console.log("valor n: "+n); | |
console.log("valor m: "+m); | |
console.log("numero total: "+n*m); | |
console.log("termino"); | |
} | |
} | |
} | |
function init(){ | |
var n = 1; | |
var m = 1; | |
var a = 6; | |
var b = 6; | |
var l = 4; | |
checkLong(n, m, a, b, l); | |
} | |
init(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment