Q. %f access specifier is used for ________.

  • (A) Integral types
  • (B) Floating type
  • (C) Strings
  • (D) All of above
πŸ’¬ Discuss
βœ… Correct Answer: (B) Floating type
Explanation:

 

  • %f is a format specifier in C language used for printing floating-point numbers (i.e., float and double types).
  • It is used with printf() and scanf() functions to handle floating-point values.

Example:

#include <stdio.h>
int main() {
float num = 12.345;
printf("The number is: %f\n", num);
return 0;
}

Output:

The number is: 12.345000

Breakdown of Options:

Correct Answer:

βœ… (B) Floating type

Explanation by: Mr. Dubey

 

  • %f is a format specifier in C language used for printing floating-point numbers (i.e., float and double types).
  • It is used with printf() and scanf() functions to handle floating-point values.

Example:

#include <stdio.h>
int main() {
float num = 12.345;
printf("The number is: %f\n", num);
return 0;
}

Output:

The number is: 12.345000

Breakdown of Options:

Correct Answer:

βœ… (B) Floating type

πŸ’¬ Discussion


πŸ“Š Question Analytics

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