Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language is a hexadecimal integer starting with %x, right? How to understand it?
C language is a hexadecimal integer starting with %x, right? How to understand it?
Numbers starting with 0X or 0x are hexadecimal integers.

For example:

int red= 0xFF,green=0x80,blue = 0xaa

0xFF, 0x80 and 0xaa are hexadecimal integers.

% x- is the format definition in the output/input statement.

For example:

int y;

scanf("%x ",& ampy); //Enter an integer in the form of 16.

printf("%x %d ",y,y); //% x- output y in the form of 16, %d-output y in the form of 10.

If you type 0x 123 or 123, it means 16.

Output: 123 29 1