Advertisements
Advertisements
प्रश्न
List out the various branching statements in JavaScript?
संक्षेप में उत्तर
Advertisements
उत्तर
There are different branching statements. They are:
- if statement
- if… else statement
- else if statement
- switch statement
shaalaa.com
Introduction of Conditional Statements in Java
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
APPEARS IN
संबंधित प्रश्न
_______ statement can be used as alterative to if-else statement.
<script type=“text/javascript”>
x = 6 + “3”;
document.write(x);
</script>
what will be the output?
What is meant by conditional statements in JavaScript?
Differentiate the break and continue statement.
Write the syntax for else-if statement.
Explain switch case statement with example.
Consider the following program segment and select the output of the same when n = 10:
switch(n)
{Case 10: System.out.println(0*2);
case 4: System.out.println(n*4); break;
default : Syslem.out.println(n);
}Which of the following data type cannot be used with switch case construct?
Rewrite the following code using single if statement.
if(code=='g')
System.out.println("GREEN");
else if(code=='G')
System.out.println("GREEN");A student executes the following program segment and gets an error. Identify the statement which has an error, correct the same to get the output as WIN.
boolean x=true;
switch(x)
{ case 1:System.out.println("WIN");break;
case 2;System.out.println("LOOSE");
}