Can any one explain why we got this kind of output and also say me when " float is true " and "double is false" gets printed ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can any one explain why we got this kind of output and also say me when " float is true " and "double is false" gets printed ?

#include<stdio.h> int main() { float i =0.1; double j =0.1; if(i == 0.1) puts("float is true\n"); else puts("float is false\n"); if(j == 0.1) puts("double is true\n"); else puts("double is false\n"); return 0; } ------------- Output: ------------- float is false double is true

25th Aug 2019, 9:41 AM
Kiran Deep Naidu
Kiran Deep Naidu - avatar
1 Answer
25th Aug 2019, 11:17 AM
HonFu
HonFu - avatar