Advertisements
Advertisements
Question
What will be the output for the following snippet:
For (var n=0; n<10; n++)
{
if (n==3)
{
break;
}
document write (n+”<br>”);
}Options
0 1 2
0 1 2 3
0 1 2 3 4
0 1 3
Advertisements
Solution
0 1 2
APPEARS IN
RELATED QUESTIONS
Which conditional statement is used to transfer control from current statement to another statement?
_______ statement can be used as alterative to if-else statement.
Which statement in switch case is used to exit the statement once the appropriate choice is found?
In which loop the condition is evaluated, before executing a statement?
<script type=“text/javascript”>
x = 6 + “3”;
document.write(x);
</script>
what will be the output?
What is if statement and write its types.
Write the syntax for else-if statement.
What message will be displayed, if the input for age is given as 20, for the following snippet?
The absence of which statement leads to fall through situation in switch case statement?
Which of the following is not true with regards to a switch statement?
