+ 1
Problem in understanding the code execution?
From code output why hello is not printed instead of hi...? https://code.sololearn.com/cPlyxS27TtNx/?ref=app #include <stdio.h> int main() { float a = 0.7; if(0.7>a){ printf("hi"); }else{ printf("hello"); } return 0; }
2 Respuestas
+ 2
Float numbers aren't perfectly accurate but are rounded in order to store the number inside 32 bit. Therefore you should never rely on exact float values but always tolerate a small offset.
+ 2
Aaron Eberhardt Thank u.....😊.....I understood!