Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - int a=2 1,b = 02 1; printf("%x,%d ",a,b); The output results are 15 and 17. Why?
int a=2 1,b = 02 1; printf("%x,%d ",a,b); The output results are 15 and 17. Why?
A=2 1 This is a decimal value.

B=02 1 This is an octal value, and its hexadecimal value 10 is 17.

When outputting, %x outputs a, the form of %x is 16, and 16 of a is 0x 15, so 15 is output here.

%d outputs b, and the form of% d is 10, so 17 is output.