-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcalc.js
29 lines (29 loc) · 914 Bytes
/
calc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
let c = 0;
function add() {
var nbr1, nbr2, sum;
nbr1 = Number(document.getElementById("no").value);
nbr2 = Number(document.getElementById("no1").value);
sum = nbr1 + nbr2;
document.getElementById("disp").textContent = sum;
}
function sub() {
var nbr1, nbr2, sum;
nbr1 = Number(document.getElementById("no").value);
nbr2 = Number(document.getElementById("no1").value);
sum = nbr1 - nbr2;
document.getElementById("disp").textContent = sum;
}
function divi() {
var nbr1, nbr2, sum;
nbr1 = Number(document.getElementById("no").value);
nbr2 = Number(document.getElementById("no1").value);
sum = nbr1 / nbr2;
document.getElementById("disp").textContent = sum;
}
function multi() {
var nbr1, nbr2, sum;
nbr1 = Number(document.getElementById("no").value);
nbr2 = Number(document.getElementById("no1").value);
sum = nbr1 * nbr2;
document.getElementById("disp").textContent = sum;
}