In your code, what you've tried
else if(18.5<=bmi<23)
No, this kind of chaining of Relational operators is not possible in C. You should write
else if((18.5<=bmi) && (bmi < 23))
to check bmi
value in [18.5, 23)
and so on for the other cases.
EDIT:
Just to elaborate about the issue, an expression like
18.5<=bmi<23
is perfectly valid C syntax. However, it is essentially the same as
((18.5<=bmi) < 23 )
due to the operator associativity.
So, first the (18.5<=bmi)
is evaluated and the result , (0 or 1) gets to get comapred against 23
, which is certainly not you want here.