CFORBEGINNERS.COM

C Answers on Switch Statements

1. In a switch statement what must come after every case?
    a) curly braces
    b) scanf
    c) break

2. Can cases have conditions?
    a) yes
    b) no
	
3. What is wrong with this? case (x > 2):
    a) cases can't have conditions
    b) cases must be capitalized
    c) cases must have ; not :


4. What is wrong with this? case 2:
    a) cases must be capitalized
    b) cases must have ; not :
    c) nothing

5. True or false, cases must have curly braces like if statements
    a) true
    b) false