Skip to content

Instantly share code, notes, and snippets.

@Ifmr24
Created September 18, 2018 01:56
Show Gist options
  • Select an option

  • Save Ifmr24/d317b33e6dfa4eecabf0ddba9d170631 to your computer and use it in GitHub Desktop.

Select an option

Save Ifmr24/d317b33e6dfa4eecabf0ddba9d170631 to your computer and use it in GitHub Desktop.
JS Ejercicio 5
/*
Hacer un programa que nos diga
si un numero es par o impar
*/
var num = parseInt( prompt("Ingresa un Numero") )
while(isNaN(num)){
var num = parseInt( prompt("Ingresa un Numero valido") )
}
if(num%2 == 0){
document.write("El numero es par")
}
else if(num == 0){
document.write("0 no es un numero valido")
}
else{
document.write("El numero es Impar")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment