What will be the output #include { float f = 0.1; if (f == 0.1) printf("yes\n"); else printf("no\n"); return 0; }?
Answers
Answered by
5
The output Is NO...............
Answered by
7
Answer:
Output will be NO
Explanation:
Here f is a floating point variable where value of 0.1 is assigned.
When this is compared using if loop in the next statement, f==0.1 returns false. The reason is 0.1 is a double value and it does not matches. In order to print yes, the condition must be f==0.1 f, where f indicates the value is typecasted to float. Always we must write ‘f’ next to the value of any floating point number.
Similar questions
Environmental Sciences,
8 months ago
Social Sciences,
8 months ago
Math,
8 months ago
Political Science,
1 year ago
Biology,
1 year ago
Physics,
1 year ago
Science,
1 year ago