JavaScript Program to display the sum of two numbers

In this program, you will learn how to display the sum of two numbers in JavaScript.


let x = 10
let y = 20
    
    OR

var x = 10
var y = 20

JavaScript Program to display the sum of two numbers

Example: How to display the sum of two numbers in JavaScript

let x = 10
let y = 20

z = x + y

console.log("Sum is:" +z)

Output:

Sum is:30