So i have got a problem with floating point variables. can someone explain? the code is given below...
#include<stdio.h>
void main() {
float b=3.6;
if(b==3.6)
{
printf("one");
}
if(b<=3.6)
{
printf("two");
}
if(b>=3.6)
{
printf("three");
}
else printf("four");
}
Now why is the Output "two" and "four"? and how do i avoid such things in pprograms?