Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

2 of 4
formatted code ..
Levon
  • 144.1k
  • 35
  • 205
  • 194

Why the control goes in "else" part?

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.

user1593308
  • 571
  • 1
  • 4
  • 5
lang-c

AltStyle によって変換されたページ (->オリジナル) /