0% found this document useful (0 votes)
26 views2 pages

Format Specifiers

Uploaded by

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

Format Specifiers

Uploaded by

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

Format specifier Description Supported data types

char
%c Character
unsigned char
short
unsigned short
%d Signed Integer int
long
%e or %E Scientific notation of float values float
double
%f Floating point float
float
%g or %G Similar as %e or %E double
%hi Signed Integer(Short) short
%hu Unsigned Integer(Short) unsigned short
short
unsigned short
%i Signed Integer
int
long
%l or %ld or %li Signed Integer long
%lf Floating point double
%Lf Floating point long double
unsigned int
%lu Unsigned integer unsigned long
%lli, %lld Signed Integer long long
%llu Unsigned Integer unsigned long long

short
unsigned short
%o Octal representation of Integer. int
unsigned int
long

%p Address of pointer to void void * void *

%s String char *
unsigned int
%u Unsigned Integer unsigned long

short
unsigned short
%x or %X Hexadecimal representation of Unsigned Integer int
unsigned int
long
%n Prints nothing
%% Prints % character
Format Specifier Type
%c Character
%d Signed integer
%e or %E Scientific notation of floats
%f Float values
%g or %G Similar as %e or %E
%hi Signed integer (short)
%hu Unsigned Integer (short)
%i Unsigned integer
%l or %ld or %li Long
%lf Double
%Lf Long double
%lu Unsigned int or unsigned long
%lli or %lld Long long
%llu Unsigned long long
%o Octal representation
%p Pointer
%s String
%u Unsigned int
%x or %X Hexadecimal representation
%n Prints nothing
%% Prints % character

You might also like