Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What do %d and %f mean in C language?
What do %d and %f mean in C language?
%d represents the input or output decimal signed number; %f represents an input or output floating-point number (four bytes); When outputting different data in C language, different format characters are needed. %d is used to output the actual length of decimal integer data, and %f is used to output single-precision and double-precision degrees in decimal form. The following is a detailed introduction:

1 and %d represent decimal signed number input or output;

2.%f represents an input or output floating-point number (four bytes);

3. The other %lf represents the input or output of double-precision floating-point number (double 8 bytes);

4. Use different format characters when outputting different data. For example, this %d is used to output the actual length of decimal integer data; %f outputs single and double precision degrees in decimal form, and implicitly outputs 6 decimal places; There are many others, such as %s (output string)