one question i had about the switch case is that why it does not allowed float double and long in the switch case ?what's the actual reason behind this?
Probably because comparing floating point values for equality is problematical. Floating point values are usually compared to be within a small range of each other, say 0.0000001. Exact equality is not really achievable at all possible values a floating point number can have.
Comparing floating-point numbers may lead to imprecision. In fact, this is probably a common rule in programming languages (well, at least in C++), because floating-point numbers are ruled by an IEEE (754) standard.
See #20 here for an introduction on floating point numbers, and a discussion of how they are imprecise. Specifically, with FP numbers the value "1.0" is not always equal to itself when it should be, e.g. 1.0 != 2.0/3.0 + 1.0/3.0.