Last active
October 23, 2015 19:38
-
-
Save rxlabz/9c76a3ddbbdb0b9df3c3 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
/* | |
* executable dans la console js de http://repl.it | |
*/ | |
console.log("saisiez une operation"); | |
console.read(function(operation){ | |
console.log("choisir un premier nombre") | |
console.read(function(nombre1){ | |
nombre1 = Number(nombre1); | |
console.log("choisir un deuxieme nombre") | |
console.read(function(nombre2){ | |
nombre2 = Number(nombre2) | |
if(operation==="addition"){ | |
console.log(nombre1 + nombre2); | |
} | |
else if(operation==="soustraction"){ | |
console.log(nombre1-nombre2); | |
} | |
else if(operation==="multiplication"){ | |
console.log(nombre1*nombre2); | |
} | |
else if (operation==="division"){ | |
console.log(nombre1/nombre2); | |
} | |
else { | |
console.log("operation non valide"); | |
} | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment