The switch/case statement in the c language is defined by the language specification to use an int value, so you can not use a float value . The value of the ‘expression’ in a switch-case statement must be an integer, char, short, long. Float and double are not allowed.