-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
21 lines (21 loc) · 908 Bytes
/
index.js
File metadata and controls
21 lines (21 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var prompt = require("prompt-sync")();
var n1 = parseInt(prompt('Please enter your first number:'));
var n2 = parseInt(prompt('Please enter your second number:'));
var operator = prompt('Please enter your operator (+, -, *, /):');
if (operator == '+') {
console.log("the anser of".concat(n1, " ").concat(operator, " ").concat(n2, " = ").concat(n1 + n2));
}
else if (operator == '-') {
console.log("the anser of".concat(n1, " ").concat(operator, " ").concat(n2, " = ").concat(n1 - n2));
}
else if (operator == '*') {
console.log("the anser of".concat(n1, " ").concat(operator, " ").concat(n2, " = ").concat(n1 * n2));
}
else if (operator == '/') {
console.log("the anser of".concat(n1, " ").concat(operator, " ").concat(n2, " = ").concat(n1 / n2));
}
else {
console.log('please select the correct operators');
}