Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C language, such as printf(...%u ...) and %d are the same, but what does it mean? And %o, can you be a little more red?
In C language, such as printf(...%u ...) and %d are the same, but what does it mean? And %o, can you be a little more red?
%u is used to output unsigned data, which is unsigned and output in decimal form.

The output of %d is integer data with negative sign.

Generally speaking, the number output in %d format can have a negative sign, and all books output in %u format have no negative sign. If you use them to output the same positive number, the result is the same, but the result is different when you output a single negative number. For example, if-1 is output in %u format, the result is 65535 (in Turbo C environment).

The output of %o is an octal number, for example, 83, which means 123.

# include & ltstdio.h & gt

void main()

{

int a = 83

printf("%d,%o\n ",a,a);

The result is: 83, 123.