Possible Duplicate:
Most effective way for float and double comparison
strange output in comparison of float with float literal
int main() 
{
  float a = 0.8;
  if (a == 0.8)
    printf("x\n");
  else 
    printf("y\n");
  return 0;
}
Though a is equal to 0.8, it outputs y.
 
     
     
     
     
     
     
     
    