Skip to content

Commit 69a0543

Browse files
Update Sum of Numbers.js
1 parent 81943a8 commit 69a0543

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

JavaScript Interview Programs/Sum of Numbers.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
// Common Ways to Add Numbers In JavaScript
1+
// ***************************************************** Common Ways to Add Numbers In JavaScript *************************************************************************
22

33
// 1. Normal Variable Addition (Direct Way)
4-
const a = 10;
5-
const b = 20;
6-
const sum = a + b;
7-
console.log("Addition of two number:", sum);
8-
// output:
9-
// Addition of two number: 30
4+
const a = 10;
5+
const b = 20;
6+
const sum = a + b;
7+
console.log("Addition of two number:", sum);
8+
// output:
9+
// Addition of two number: 30
1010

1111
// 2. Using Function()
12-
1312
// Function to calculate the sum of two numbers using a temporary variable:
1413
function Sum(a, b){
1514
const c = a + b;

0 commit comments

Comments
 (0)