Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var c = prompt("Calculate Program \n1. Add numbers \n2. Subtract numbers \n3. Multiply numbers \n4. Divide numbers \nWhat's your choice ?")
- var num1 = parseInt(prompt("Enter the first number "))
- var num2 = parseInt(prompt("Enter the second number "))
- if (c == 1) {
- console.log(num1 + num2)
- } else if (c == 2) {
- console.log(num1 - num2)
- } else if (c == 3) {
- console.log(num1 * num2)
- } else if (c == 4) {
- console.log(num1 / num2)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement