Which of the following is the correct output for the following JavaScript code:
var x=3;
var y=2;
var z=0;
If(x==y)
document.write(x);
elseif(x==y)
else
document.write(z);
a) 3
b) 0
c) Error
d) 2
Answer: B
Reason: The "if-and if" statement is used to examine more than one condition. This is an extension of the "if-else" statement and is also known as the "if-else ladder". We can extend the "if-else" statement to check several conditions.