15 lines
254 B
JavaScript
15 lines
254 B
JavaScript
const prompt = require("prompt-sync")({sigint: true});
|
|
|
|
function add(a, b) {
|
|
let e = a + b;
|
|
return e;
|
|
}
|
|
|
|
let c = prompt("Num 1: ");
|
|
let d = prompt("Num2: ");
|
|
let op = prompt("What operation? ");
|
|
|
|
if (op == "+") {
|
|
console.log(Number(c) + Number(d));
|
|
}
|