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.
Related Posts
The basic difference between JavaScript and Java is _________
What will be the output of the following JavaScript code?
var o = new F();
o.constructor === FThe keyword or the property that you use to refer to an object through which they were invoked is _________
The behaviour of the instances present of a class inside a method is defined by __________
What will be the output of the following JavaScript code?
var a=225;
document.writeln(Math.sqrt(a));What will be the output of the following JavaScript code?
var a=2.99;
var ans=floor(a)*floor(a)
console.log(ans);What will be the output of the following JavaScript code?
var a=3.7;
var b=2;
a=ciel(a)
document.writeIn(a*b);
Join The Discussion