-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
40 lines (31 loc) · 822 Bytes
/
app.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
30
31
32
33
34
35
36
37
function getNumber(num){
var number = document.getElementById("Number");
number.value += num;
}
function clearScreen(){
var number = document.getElementById("Number");
number.value = "";
}
function ans() {
var number = document.getElementById("Number");
number.value = eval(number.value);
}
function power() {
var number = document.getElementById("Number").value;
document.getElementById("Number").value=Math.pow(number,2);
}
function square() {
var number = document.getElementById("Number").value;
document.getElementById("Number").value=Math.sqrt(number);
}
function factorial()
{
var i, no, fact;
fact=1;
no=Number(document.getElementById("Number").value);
for(i=1; i<=no; i++)
{
fact= fact*i;
}
document.getElementById("Number").value= fact;
}