Home >Backend Development >C#.Net Tutorial >What does %4d mean in C language?

What does %4d mean in C language?

藏色散人
藏色散人Original
2020-04-30 11:07:4829274browse

What does %4d mean in C language?

c language %4d What does it mean?

%4d means to output a 4-digit long integer character. %4d is a format character in C language and is used to output decimal integers. %md, m is the width of the specified output field.

Recommended: "c Language Tutorial"

%d, output according to the actual length of integer data. %ld, output long integer data.

What does %4d mean in C language?

Extended information

1. The o format character outputs integers in octal integer format.

2. x format character, output integer in hexadecimal format.

3. The u format character is used to output unsigned data, that is, unsigned numbers, output in decimal form.

4. The c format character is used to output a character.

5. s format character, used to output a string.

6. The f format character is used to output real numbers (including single and double precision) in decimal form.

7. The e format character outputs real numbers in exponential form.

8. The g format character is used to output real numbers. It automatically selects f format or e format according to the size of the value (the selected output is the one with a smaller width), and does not output meaningless zeros. .

9. p format character, used for output of variable address.

The above is the detailed content of What does %4d mean in C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn