Single Choice Not Set

QSuppose a C program has floating constant 2.76, what's the best way to convert this as "float" data type?

ID: #904 Data Types in C Language 1,438 views
Question Info
#904Q ID
Not SetDifficulty
Data Types in C LanguageTopic

Choose the Best Option

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

  • A (float)2.76
  • B 2.76f or 2.76F
  • C 2.76 itself of "float" data type i.e. nothing else required.
  • D float(2.76)
Correct Answer

Explanation

By default floating constant is of a double data type. By suffixing it with f or F, it can be converted to float data type. For more details, this post can be referred here.

Share This Question

Challenge a friend or share with your study group.