Ask Question

Which of the following statements is true?

a. Strings can be used in a switch statement's controlling expression and in its case labels.

b. Strings can be used in a switch statement's controlling expression but not in its case labels.

c. Strings cannot be used in a switch statement's controlling expression but can be used in its case labels.

d. Strings cannot be used in a switch statement's controlling expression and cannot be used in its case labels.

+5
Answers (1)
  1. 22 September, 18:53
    0
    Answer: A) Strings can be used in a switch statement's controlling expression and in its case labels.

    Explanation:

    This statement is true as string is use in the switch statement for controlling the expression and also used in its particular case label.

    Switch statement basically used to test the values of the variable and used to compare the multiple cases.

    Strings use the different types of literals and constant to control the switch statement. By using the switch statement based on string it can improve the statement by using the equivalent statement such as if and else statement.

    Therefore, option (A) is correct.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of the following statements is true? a. Strings can be used in a switch statement's controlling expression and in its case labels. b. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers