-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathscript.js
More file actions
59 lines (36 loc) · 998 Bytes
/
script.js
File metadata and controls
59 lines (36 loc) · 998 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
50
51
52
53
54
55
56
57
58
console.log("Session 2");
p1 = document.getElementById("p1");
p1.innerHTML="updated p1"
p2 = document.getElementById("p2");
p2.innerHTML="updated p2"
p3 = document.getElementById("p3");
p3.innerHTML="updated p3"
// Datatypes - boolean, numbers, strings, objects
// Arithmatic operators +, -, *, /, **, %, ++, --
// WAS to concatenate your first name and last name with space in between.
a = "Shubham "
b = "Pandey"
c= a+b
console.log("Assignment-1",c)
// WAS to print 5th power of 15.
a=15**5
console.log("Assignment-2",a)
// WAS to print remainder when 22 is divided by 7
a=22%7
console.log("Assignment-3",a)
// Assign a variable with value 5 and post increment it thrice, print its value every time
a=5
a++
console.log("Assignment-5",a)
a++
console.log("Assignment-5",a)
a++
console.log("Assignment-5",a)
// Pre increment the same variable thrice and print its value
a=5
++a
console.log("Assignment-6",a)
++a
console.log("Assignment-6",a)
++a
console.log("Assignment-6",a)