How to use %d %s %c %x %p %u %f %lf %%

%d

%nd

//It means to print a few significant digits, when the result is <n, the result will be printed on the right side

// print as an integer

.

%c

//Print in characters

.

%s

//Print as a string

.

%x

//Print in hexadecimal form

.

%p

//Print as a pointer

.

% u

//Print as unsigned integer

.

%f

% m.nf

//eg: %6.4f means that the print result has 6 significant digits and 4 decimal places.

//Print as a single-precision floating-point number

.

%lf

//Print as a double-precision floating point number

//%m.nlf Same as above

.

%%

//Print% sign

Guess you like

Origin blog.51cto.com/14982125/2551428