Question
Comment on the output of this C code?   int main()   {       float f1 = 0.1;       if (f1 == 0.1)           printf("equal\n");       else           printf("not equal\n");   }
Answer: Option B
Was this answer helpful ?
0.1 by default is of type double which has different representation than float resulting in inequality even after conversion.
Output:
$ cc pgm4.c
$ a.out
not equal
Was this answer helpful ?
More Questions on This Topic :
Question 7. %f access specifier is used for? ....
Question 10. Which of the following % operation is invalid? ....
Submit Solution