-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
55 lines (48 loc) · 1.12 KB
/
app.js
File metadata and controls
55 lines (48 loc) · 1.12 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//q1
var input1 = prompt('please input a number(+ or - )');
if (Number(input1) >= 0)
{
document.write("Positive number");
} else {
document.write("Negative number");
}
//q2
/*var input1 = prompt("please enter the first number");
var input2 = prompt("please enter the second number");
var input3 = prompt("please enter the third number");
if (input1 > input2)
{
if(input1 > input3)
{
console.log(input1 + " is the max");
} else { console.log(input3 + " is the max");}
} else {
if (input2 > input3)
{
console.log(input2 + " is the max");
} else {console.log(input3 + " is the max");}
}*/
//q3
/*var i;
var i2=0;
for (i=0; i < 20 ; i++){
console.log( i + " is even");
i2=i+1;
console.log (i2 + " is odd");
i=i+1;
}*/
//q4
/*var i;
var sum=0;
for (i=0;i<=100;i=i+2){
sum=sum+i;
}
console.log(sum);*/
//q5
/*var input1 = prompt (" enter the first number");
var input2 = prompt ("enter the second number");
var sum;
sum = Number(input1) + Number(input2);
mult = input1 * input2;
console.log( 'the sum is' + sum);
console.log("the multiplication is" + mult);*/