+ 4
In the code given below the output comes "True"... So plz. explain what is happening in the compiler...
float a = 0.7; if(0.7>a)printf("True"); else printf("False"); As it is treating 0.7 greater than 0.7 contained in a float variable...
5 Answers
+ 7
In if statement you are comparing a double precision floating point to a single precision floating point.
0.7 (double)approximate value is greater than 0.7f
+ 6
Testing equality is also tricky with floating point numbers.
+ 2
Thanks... now i got it...
+ 2
thankyou