-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmax-number.js
More file actions
42 lines (28 loc) · 790 Bytes
/
max-number.js
File metadata and controls
42 lines (28 loc) · 790 Bytes
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
let salman = 78;
let disha = 65;
if (salman > disha) {
console.log("salman will get the cake");
} else {
console.log("disha will get the cake");
}
// inside a function
function max_number(num_1, num_2) {
if (num_1 > num_2) {
console.log("number 1 is bigger than number 2");
} else {
console.log("number 2 is bigger than number 1");
}
}
// max_number(54, 89);
let jim = 89;
let tim = 96;
let kim = 55;
if (jim > tim && jim > kim) {
console.log("jim is greater than tim & kim");
} else if (tim > jim && tim > kim) {
console.log("tim is greater than jim & kim");
} else {
console.log("kim is greater than jim & tim");
}
let max = Math.max(12, 55, 90, 98, 5, 44, 1, 3, 5);
console.log("max number is", max);