Q. %lf is used to display?

  • (A) long float
  • (B) double
  • (C) float
  • (D) All of above
πŸ’¬ Discuss
βœ… Correct Answer: (A) long float
Explanation:

 

  • In C, float, double, and long double are different data types.
  • %lf is used in printf() to format and display a double value.
  • However, in scanf(), %lf is used to read a double value, whereas %f is used for float.

Correct Format Specifiers:

Thus, %lf is specifically used for double.

Explanation by: Mr. Dubey

 

  • In C, float, double, and long double are different data types.
  • %lf is used in printf() to format and display a double value.
  • However, in scanf(), %lf is used to read a double value, whereas %f is used for float.

Correct Format Specifiers:

Thus, %lf is specifically used for double.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
255
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Akash Lawaniya
Publisher
πŸ“ˆ
84%
Success Rate