Created
September 23, 2016 16:05
-
-
Save kodamirmo/dfb0e58b1c2d116a261213c35a6807b4 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
var n = prompt('Ingresa el año', 'Año'); | |
n = Number(n); | |
console.log('El año es: ' + n); | |
//for (var i=1; i<=n; i++) { | |
var i=1; | |
do { | |
if ( ( (i % 4 === 0) && (i % 100 !== 0) ) || ( i % 400 === 0)) { | |
//Si es | |
console.log('El año ' + i + ' Si es'); | |
} else { | |
//No es | |
console.log('El año ' + i + ' No es'); | |
} | |
i++; | |
} while(i<=n) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment