Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
int a=4;
int b=1;
int c=0;
If(a==b)
document.write(a);
else if(a==c)
document.write(a);
else
document.write(c);

What will be the output of the following JavaScript code?
int a=4;
int b=1;
int c=0;
If(a==b)
document.write(a);
else if(a==c)
document.write(a);
else
document.write(c);
a) 4
b) 1
c) Error
d) 0

Answer: d
Explanation: For checking more than one condition the if else if loop is used. It is the extension of if else loop which is also sometimes known as if else ladder.

Join The Discussion