Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following cannot be checked in a switch-case statement?

  • A.Character
  • B.Integer
  • C.Float
  • D.enum

Answer: C

Correct answer: Float

A switch requires an integer controlling expression, so char, int and enumeration constants are all fine. float is not: exact equality against a case label would be unreliable for values that cannot be represented exactly in binary.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.