forked from codehouseindia/Everything
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascriptbysamahith
More file actions
50 lines (33 loc) · 1016 Bytes
/
javascriptbysamahith
File metadata and controls
50 lines (33 loc) · 1016 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
38
39
40
41
42
43
44
45
46
47
48
49
// without using if statemnts
var age = 20;
// age for children
var ifChildren = age <= 18;
// age for seniors
var ifSenior = age >= 65;
// age for adults
var ifAdults = age >= 18;
// output
console.log('ifChildren', "you are a child ");
console.log('ifSenior', "you are a senior citizen ");
console.log('ifAdults', "you are a Adults ");
// using if statements
age2 = 67;
if (age2 <= 18) {
console.log("you are a child you are not allowed")
}
if (age2 <= 65 ) {
console.log("man you can go in have fun ");
}
if (age2 >= 66) {
console.log("man you can\'t go in u are too old for this ");
}
let temparature = 41;
if (temparature >= 30, temparature < 50) {
console.log(" dont go for it brother its too Hot");
}else if (temparature >= 20, temparature < 10){
console.log(" dont go for it brother its too cold");
} else if (temparature <= 40, temparature < 45 ) {
console.log("go for it brother");
} else {
console.log('enter correct temparature but not strings');
}