6. The syntax of an if-else statement is: if :
statement1
statement2
else:
statement3
statement4
What is the output of the following code? x= 9 if(x == 10): print('x is equal to 10') else: print('x is not equal to 10')
9. The syntax of the switch statement is:
switch () {
case value1:
// code to be executed for value1
break;
case value2:
// code to be executed for value2
break;
default:
// code to be executed if none of the cases match
}
2. statements are used to control the flow of a program based on certain conditions.
Which statement is used to stop the execution of a loop in JavaScript?
Condition
What is the purpose of else statements in if-else statements?
4. The syntax of an if statement is: if :
statement1
statement2
What is the syntax for an if statement in JavaScript?
Execution path
1. In programming, refers to the order in which statements are executed.
Switch statement
Nested if statement
What is the purpose of an else statement in a nested if-else statement?
What is the purpose of the 'default' case in a switch statement?
What is the purpose of else if statements in if-else statements?
Default case
What is the purpose of switch statements?
What is the purpose of a chained if-else statement?