What is the syntax for an if statement in JavaScript?
What is the purpose of else if statements in if-else statements?
2. statements are used to control the flow of a program based on certain conditions.
How do you define multiple cases in a switch statement in Python?
What is the purpose of if statements?
6. The syntax of an if-else statement is: if :
statement1
statement2
else:
statement3
statement4
What are switch statements?
Selection
5. The if-else statement allows for execution paths.
Which comparison operator is used to check if two numbers are equal?
Execution path
Condition
Switch statement
How can we check if a number is greater than 5 using an if statement?
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
}
How many conditions can be checked in a chained if-else statement?
10. The if statements are used when an if statement is present inside another if statement.
What is the purpose of an else statement in a nested if-else statement?
8. In Python prior to version 3.10, the switch statement used to be implemented using the ladder.