Single Choice Not Set

QWhat is the output of this C code?

#include <stdio.h>
int main()
 {
  float f1 = 0.1;
  if (f1 == 0.1f)
  printf("equal\n");
  else
  printf("not equal\n");
 }

ID: #892 Data Types in C Language 7,915 views
Question Info
#892Q ID
Not SetDifficulty
Data Types in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A not equal
  • B equal
  • C Output depends on compiler
  • D None of the mentioned
Correct Answer

Explanation

Output

equal

0.1f results in 0.1 to be stored in floating point representations.

Share This Question

Challenge a friend or share with your study group.