LearnFrenzy
Sign in Take a free test

Control Instructions · Control Instructions MCQ · Question 5

Rules for case labels in a C switch Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 5 Back to Exercise

Which statement about case labels is true?

  • A They can be any variable
  • B They must be distinct integer constant expressions Correct
  • C They must be in ascending order
  • D They can be strings
Correct Answer: Option B

Each label must be known at compile time (a literal, character constant, enum constant or macro) and no two may be equal. Their order is free.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links