Exercise :: Control Instructions - Yes / No Questions
1. | The way the break is used to take control out of switch and continue to take control of the beginning of the switch? |
|||
Answer: Option B Explanation: continue can work only with loops and not with switch
|
2. | Can we use a switch statement to switch on strings? |
|||
Answer: Option B Explanation: The cases in a switch must either have integer constants or constant expressions.
|
3. | We want to test whether a value lies in the range 2 to 4 or 5 to 7. Can we do this using a switch? |
|||
Answer: Option A Explanation: We can do this in following switch statement
|
4. | By default, the data type of a constant without a decimal point is int, whereas the one with a decimal point is a double. |
|||
Answer: Option A Explanation:
6 is int constant. |