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?
var a = 10;
do {
a += 1;
console.log(a);
} while (a < 5);

What will be the output of the following JavaScript code?
var a = 10;
do {
a += 1;
console.log(a);
} while (a < 5);
a) 11121314
b) 1112
c) 12345
d) 11

Answer: d
Explanation: dowhile loop first executes the statements and after that checks for the condition. Therefore dowhile loop will be executed and after that the condition will become false and the loop will terminate.

Join The Discussion