State whether the following are true or false. If the answer is false. explain why?
State whether the following are true or false. If the answer is false. explain
why?
- The default case is required in the switch selection structure.
- The break statement is required in the default case of a switch
selection structure to exit the structure properly.
- The expression ( x > y && a < b ) is true if either
the expression x > y is true or the expression a < b is true.
- An expression containing the || operator is true if either or both
of its operands are true.
Solution
- False: The default case is optional. If no default action is needed,
then there is no need for a default case.
- False: The break statement is used to exit the switch structure.
the break statement is not required when the default case is
the last case.
- False: Both of the relational expressions must be true in order for
the entire expression to be true when using the && operator.
- True.
If You Enjoyed This, Take 5 Seconds To Share It
0 Questions:
Post a Comment