-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask2.js
65 lines (50 loc) · 1.03 KB
/
task2.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
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
//Activity 1:
let a=12
let b=3
let sum=a+b;
console.log(sum);
let sub=a-b;
console.log(sub);
let mul=a*b;
console.log(mul);
let div=a/b;
console.log(div);
let rem=a%b;
console.log(rem);
//Activity 2:
a+=b;
console.log(a);
a-=b;
console.log(a);
//value of a is changing and store the last value whcih was log the result
//Activity 3:
let x=20;
let y=17;
let greater=x>y;
console.log(greater);
let smaller=x<y;
console.log(smaller);
let greaterthanequal=x>=y;
console.log(greaterthanequal);
let smallerthanequal=x<=y;
console.log(smallerthanequal);
let p=123
let q='123'
let r=p==q;
console.log(r);
//It checks the value is equal or not(there value is same)
let s=p===q
console.log(s);
//It checks the value and type is equal or not(there value is same but type is different
// //Activity 4:
let num1=10
let num2=15
let num3=7
console.log(num1>num2 && num1>num3)
console.log(num1>num2 || num1>num3)
let num4=3
let num5=-1
console.log(!(num4>0 || num5>0));
//Activity 5:
let num=5;
console.log((num>0)? 'greater than zero':'less than zero');