0% found this document useful (0 votes)
35 views1 page

Formats in C

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Formats in C

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Format specifiers in C

Format Description Supported data types


specifier
%c Character 1. char
2. unsigned char
%d (or %i) Signed Integer 1. short
2. unsigned short
3. int
4. long
%e or %E Scientific notation of float values 1. float
2. double
%f Floating point 1. float
%g or %G Similar as %e or %E 1. float
2. double
%hi Signed Integer(Short) 1. short
%hu Unsigned Integer(Short) 2. unsigned short
%i Signed Integer 1. short
2. unsigned short
3. int
4. long
%l or %ld or Signed Integer 1. long
%li
%lf Floating point 1. double
%Lf Floating point 1. long double
%lu Unsigned integer 1. unsigned int
2. unsigned long
%lli, %lld Signed Integer 1. long long
%llu Unsigned Integer 1. unsigned long long
%o Octal representation of Integer. 1. short
2. unsigned short
3. int
4. unsigned int
5. long
%p Address of pointer to void void * 1. void *
%s String 1. char *
%u Unsigned Integer 1. unsigned int
2. unsigned long
%x or %X Hexadecimal representation of 1. Short
Unsigned Integer 2. unsigned short
3. int
4. unsigned int
5. long
%n Prints nothing
%% Prints % character

You might also like