In this article you will get list of format specifiers in C.
Format specifier is used to specify the data type while reading or writing. For example if you want to print value of an integer type variable then you have to use %d in printf() function. Take below example.
As you can see that I have used %d while reading and printing integer value.
C language has various format specifiers that I have listed below.
List of Format Specifiers in C
|Data Type||Format Specifier|
|signed char||%c (or %hhi for numerical output)|
|unsigned char||%c (or %hhu for numerical output)|
signed short int
unsigned short int
|%i or %d|
signed long int
unsigned long int
long long int
signed long long
signed long long int
|unsigned long long
unsigned long long int
|float||%f (promoted automatically to double for printf())|
(%lf (%lF) for scanf())
%e %E (for scientific notation)
|long double||%Lf %LF
Comment below if you found anything incorrect or missing in above list of format specifiers in C.