programming-examples/js/Conditional/Write a JavaScript conditional statement to find the sign of product of three numbers. Display an alert box with the specified sign..js

23 lines
506 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
var x=3;
var y=-7;
var z=2;
if (x>0 && y>0 && z>0)
{
alert("The sign is +");
}
else if (x<0 && y<0 && z>0)
{
console.log("The sign is +");
}
else if (x>0 && y<0 && z<0)
{
console.log("The sign is +");
}
else if (x<0 && y>0 && z<0)
{
console.log("The sign is +");
}
else
{
console.log("The sign is -");
}