Possible Duplicate:
Floating point comparison
When I run the code below I get the following output:
Output : if
Why does this happen?
#include <stdio.h>
void main()
{
float a = 0.7;
if(a<0.7)
{
printf("if");
}
else
{
printf("Else");
}
}