Print the List of Format Specifiers in C with Examples and also with Name, Description, & Syntax in C Language. Now the question is what are the Formate specifiers, types of formate specifiers. In c programming language we need to tell the compiler about the data type what type of data is variable contains, formate specifiers, use to tell that during input and output operations?.
What Are Format Specifiers in C
Formate specifiers tell the compiler that a variable data type, in simple words we can say that we have to provide an additions information to the compiler about the data type, which type of data is program contains while taking input and output.
So basically use of formate specifiers is Used during scanf() and the printf() operations.
Format Specifiers
So the format specifiers define the data type or type of data. Below are some examples.
Examples: %c, %d, %f, and %lf etc.

What is %s and %d in C?
%s and %d are formate specifiers in C language, %s is used to take an input of string and print the string, String is a group of characters, and %d is used to take an integer as an input and output, %d is equal to the %i. Take a look of %f format specifier.
Syntax of All Format Specifiers in C Language
- scanf(“%lf”, &Variable_Name );
- printf(“lf”, Variable_Name);
19 List of Format Specifiers in C with Examples
Name | Description | Syntax |
%c | Single Character | scanf(“%c”, &Variable_Name ); |
%s | Strings | scanf(“%s”, &Variable_Name ); |
%hi | Short(signed) | scanf(“%hi”, &Variable_Name ); |
%hu | Short(unsigned) | scanf(“%hu”, &Variable_Name ); |
%l or %ld or %li | Signed Integer(Signed Integer) | scanf(“%l”, &Variable_Name ); |
%lf | Double | scanf(“%lf”, &Variable_Name ); |
%LF | Long Double | scanf(“%LF”, &Variable_Name ); |
%lu | Unsigned integer | scanf(“%lu”, &Variable_Name ); |
%lli or %lld | Signed Integer(Long Long) | scanf(“%lli”, &Variable_Name ); |
%llu | Unsigned Integer(unsigned long long ) | scanf(“%llu”, &Variable_Name ); |
%n | Prints Nothing(No Output) | printf(“%n”, Variable_Name ); |
%d | Decimal Integer(Widely Used) | scanf(“%d”, &Variable_Name ); |
%o | Octal (Base 8) Integer | scanf(“%o”, &Variable_Name ); |
%x | Hexadecimal (Base 16) Integer for Unsigned Integer | scanf(“%x”, &Variable_Name ); |
%p | Address (Or Pointer) | scanf(“%p”, &Variable_Name ); |
%f | Floating Point Number for Floats | scanf(“%f”, &Variable_Name ); |
%u | Int Unsigned Decimal Integer | scanf(“%u”, &Variable_Name ); |
%e or %E | Floating Point Number in Scientific Notation(Float, Double) | scanf(“%e”, &Variable_Name ); |
%% | Prints % character | printf(“%%”, Variable_Name ); |
I hope you like the List of all Format Specifiers in C with Examples. Name, Description and Syntax. Below are some FAQ.
No Responses