-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathifelse.html
More file actions
98 lines (81 loc) · 2.65 KB
/
Copy pathifelse.html
File metadata and controls
98 lines (81 loc) · 2.65 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-wEmeIV1mKuiNpC+IOBjI7aAzPcEZeedi5yW5f2yOq55WWLwNGmvvx4Um1vskeMj0" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="favicon.png" type="image/png">
<title>Title</title>
</head>
<body class="bg-success">
<div class="m-5 p-5 bg-warning" style="width: auto; height: 100%;">
<form class="bg-danger-subtle"></form>
</div>
<p id="p"></p>
<script>
//greatest amoung 2
let num1 = 10;
let num2 = 20;
if (num1 > num2) {
console.log("Greater number is " + num1);
}
else {
console.log("Greater number is " + num2);
}
//largest amoung 3
let n1 = 10;
let n2 = 30;
let n3 = 20;
if (n1 >= n2 && n1 >= n3) {
console.log("Greatest Number is " + n1);
}
else if (n2 >= n3) {
console.log("Greatest number is " + n2);
}
else {
console.log("Greatest number is " + n3);
}
//smallest amoung 3
let no1 = 10;
let no2 = 30;
let no3 = 20;
if (no1 <= no2 && no1 <= no3) {
console.log("Smallest Number is " + no1);
}
else if (no2 <= no3) {
console.log("Smallest number is " + no2);
}
else {
console.log("Smallest number is " + no3);
}
//checks type too in "==="
let s1 = '5';
let s2 = 5;
if (s1 === s2) {
console.log("Numbers are equal");
}
else {
console.log("Numbers aren't equal");
}
//OR operater
let o1 = 10;
let o2 = 20;
if(o1 == o2 || o2 > o1){
console.log("Numbers are equal || Number o2 is greater. Even if one condition is true it returns TRUE!");
}
let even = 68;
if(even % 2 === 0){
console.log("Number is Even!");
}
else{
console.log("Number is Odd!")
}
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-p34f1UUtsS3wqzfto5wAAmdvj+osOnFyQFpp4Ua3gs/ZVWx6oOypYoCJhGGScy+8"
crossorigin="anonymous"></script>
<script src="script.js"></script>
</body>
</html>