-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithm_1.js
More file actions
65 lines (52 loc) · 798 Bytes
/
Algorithm_1.js
File metadata and controls
65 lines (52 loc) · 798 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
59
60
61
62
63
64
65
var x = [1,2,3,4,5,10]
for(var i=0; i<5; i++){
console.log(i)
}
//Output = 5, 8
var x = [1,2,3,4,5,10]
for(var i=0; i<5; i++)
{
i = i+1;
console.log(i)
}
//Output = 1,3,5
var x = [1,2,3,4,5,10]
for(var i=0; i<5; i++)
{
i = i+3;
console.log(i);
}
//Output = 3,7
function y(num1, num2){
return num1+num2;
}
console.log(y(2,3))
console.log(y(3,5))
//Output (y(2,3)) = 5;
//Output (y(3,5)) = 8;
function y(num1, num2){
console.log(num1);
return num1+num2;
}
console.log(y(2,3))
console.log(y(3,5))
//Output (y(2,3)) = 2,5;
//Output (y(3,5)) = 3,8;
a=15;
console.log(a);
function y(a){
console.log(a);
return a;
}
b = y(10);
console.log(b);
//Output = 15, 10, 10
a=15;
console.log(a);
function y(a){
console.log(a);
return a*2;
}
b = y(10);
console.log(b);
//Output = 15, 10, 20