What will the output of the following C code be? #include stdio.h> int main() float f1 = 0.1; if (f1 == 0.1f) printf("equaln"); otherwise printf("not equal");
A. equivalent
B. not the same
C. the output is determined by the compiler
D. none of the above
Answer:A
What will the output of the following C code be? #include stdio.h> int main() float f1 = 0.1; if (f1 == 0.1f) printf("equaln"); otherwise printf("not equal");
A. equivalent B. not the same C. the output is determined by the compiler D. none of the above
Explanation: In floating point formats, 0.1f equals 0.1. $ cc pgm5.c $ a.out =