JavaScript

May 25, 2023

How to find largest of three numbers in JavaScript

Find largest of three numbers in JavaScript program


let a = 10;
let b = 20;
let c = 5;
if (a > b && a > c) {
    console.log("a is Big ", a);
}

if (b > a && b > c) {
    console.log("b is Big ", b);
}

if (c > a && c > b) {
    console.log("c is Big ", c);
}

Output


b is Big  20

by : Suhel Akhtar

Quick Summary:

How to find largest of three numbers with Logical AND ( && ) Operator in JavaScript with example