1. Home
  2. Computer Science MCQs
  3. C Programming
  4. What restriction applies to the case labels of a switch in…

Added 30 Nov -0001

What restriction applies to the case labels of a switch in C?

  1. They must be listed in ascending order
  2. They must be integer constant expressions Correct answer
  3. They must be distinct string literals
  4. They must be variables of type int

Correct answer

B. They must be integer constant expressions

11 views

MCQSEXAM

Explanation

Each case label must be an integer constant expression whose value is known at compile time.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs