programming-examples/js/Conditional/Write a JavaScript conditional statement to find the largest of five numbers. Display an alert box to show the result..js
2019-11-15 12:59:38 +01:00

25 lines
363 B
JavaScript

a=-5;
b=-2;
c=-6;
d= 0;
f=-1;
if (a>b && a>c && a>d && a>f)
{
console.log(a);
}
else if (b>a && b>c && b>d && b>f)
{
console.log(b);
}
else if (c>a && c>b && c>d && c>f)
{
console.log(c);
}
else if (d>a && d>c && d>b && d>f)
{
console.log(d);
}
else
{
console.log(f);
}