Answered

Which of the following can be used as a case label in a switch-case statement? Please select all that apply.
Assume that FIVE is a constant int and five is an int.
#define FIVE 5
int five = 5;

a. five
b.FIVE
c.5
d.five++
e. FIVE + 1

Answer :

frknkrtrn

Answer:

b, c, and e

Explanation:

The values that are used for case labels must be a constant expression.

Let's examine the options;

a. five -> declared as just int

b. FIVE -> declared as constant expression

c. 5 -> It is a constant expression

d. five++ -> incremented version of option a

e. FIVE+1 -> incremented version of option b

Other Questions