How to write A program that helped me understand float!
I did not understand the storage of float in C/C++ until I have executed this program by accident.
Now I understand the program
printf(“I love you”);
printf(“I hate you”);
The output is I hate you. I was under the false impression that it was due to the size. but it is not. It is due to the precision actually.
0.7=0.7000000000 which is not equal to 0.7f=0.6999999881!
Now it makes sense. I prepared so many questions like this for my Cognizant interview. But this is the only one that I remember now.