✏️ Explanatory Question

What are the most commonly used Format Specifiers in C?

👁 9 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

C provides multiple format specifiers for different data types. Below are the most commonly used ones:

Specifier Data Type Description
%dintInteger value
%ffloatFloating-point number
%ccharSingle character
%sstringString of characters
%lfdoubleDouble precision float
%xintHexadecimal format
%ointOctal format
  Choosing the correct format specifier is critical—wrong specifiers lead to incorrect outputs or runtime errors.