Single Choice
Not Set
QWhat is the output of this C Program?
#include
int main()
{
float f1 = 0.1;
if (f1 == 0.1)
printf("equal\n");
else
printf("not equal\n");
}
ID: #891
Data Types in C Language
2,263 views
Question Info
#891Q ID
Not SetDifficulty
Data Types in C LanguageTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
Output
not equal
0.1 by default is of type double which has different representation than float resulting in inequality even after conversion.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic