C | Loops & Control Structure | Question 15
In the following program, X represents the Data Type of the variable check.
#include <stdio.h> int main() { X check; switch (check) { // Some case labels } return 0; } |
chevron_right
filter_none
Which of the following cannot represent X?
(A) int
(B) char
(C) enum
(D) float
Answer: (D)
Explanation: A switch expression can be int, char and enum. A float variable/expression cannot be used inside switch.
Quiz of this Question
Recommended Posts:
- C | Loops & Control Structure | Question 4
- C | Loops & Control Structure | Question 13
- C | Loops & Control Structure | Question 1
- C | Loops & Control Structure | Question 10
- C | Loops & Control Structure | Question 7
- C | Loops & Control Structure | Question 5
- C | Loops & Control Structure | Question 11
- C | Loops & Control Structure | Question 12
- C | Loops & Control Structure | Question 6
- C | Loops & Control Structure | Question 3
- C | Loops & Control Structure | Question 2
- C | Loops & Control Structure | Question 9
- C | Loops & Control Structure | Question 18
- C | Loops & Control Structure | Question 20
- C | Loops & Control Structure | Question 17



