State whether each of the following is true or false. Explain why.
Statement 1 is false. The default case is option in the switch case. If no default case is required then there is no need for a default case.
Statement 2 is false. The beak statement is used to exit the switch statement. The break statement is not compulsory in last line for the switch case statement.
Statement 3 is false. When both x > y and a < b will be true then the given expression ( (x > y) && (a < b ) ) is true.
Statement 4 is true.
Statement 5 is true.
Statement 6 is false. Switch statement does not provide the mechanism for the testing ranges or values. So every which we are going to test should be in separate case label.
Statement 7 is true.
Comments
Leave a comment