Skip to content

Commit 322a93c

Browse files
Update and rename Sum of Two Number.js to Sum of Numbers.js
1 parent dadd8a0 commit 322a93c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

JavaScript Interview Programs/Sum of Two Number.js renamed to JavaScript Interview Programs/Sum of Numbers.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@
44
const a = 10;
55
const b = 20;
66
const sum = a + b;
7-
console.log("Addition of two number": sum);
7+
console.log("Addition of two number", sum);
88
// output:
99
// Addition of two number: 30
1010

11+
// Using Function()
12+
function sum(a, b){
13+
const c = a + b;
14+
}
15+
return c;
16+
sum(4,5);
17+
18+
1119
// 2. One-Line Addition (Used for Console testing or demo purpose)
1220
Console.log(10+5);
1321
// Output:
@@ -21,3 +29,5 @@
2129
// Enter frist number: 2
2230
// Enter second number: 8
2331
// Sum: 10
32+
33+
// OR

0 commit comments

Comments
 (0)