0

Please explain this:

int main()
{   
    float f = 0.7;
    if(f<0.7)
        printf("Y");
    else
        printf("N");
    return 0;
}

Output: Y

But, for this code

int main()
{
    float f = 0.8;
    if(f<0.8) 
        printf("Y");
    else   
        printf("N");
    return 0;
}

Output is N. What causes such difference in the output? Please try to explain in detail. Thanks in advance.

StoryTeller - Unslander Monica
  • 165,132
  • 21
  • 377
  • 458

0 Answers0