LearnFrenzy
Sign in Take a free test

Control Instructions · Control Instructions MCQ · Question 4

Which type cannot be used in a C switch? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 4 Back to Exercise

Which of these cannot be the controlling expression of a switch?

  • A char
  • B enum value
  • C long
  • D double Correct
Correct Answer: Option D

A switch needs an integer type. Floating-point values are not allowed (exact comparison of doubles would be unreliable anyway), and neither are strings.

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