Example:
int main(){
int a;
scanf("%p ",& ampa); // 16 hexadecimal number input %p is to input a hexadecimal number scanf ("%llx ",&; a); You can also enter hexadecimal, which is more formal.
printf("%d ",a); //Decimal output %d is a decimal number.
printf("0x%x ",a); // 16 binary output printf("%llX\n ",a); You can also output a hexadecimal number. If the red part is uppercase X, hexadecimal output is uppercase letters, otherwise lowercase X is lowercase letters.
}
Extended data
C language defines the hexadecimal number of integer data;
Unsigned inthex _ val = 0x123;
//Define an integer variable and assign the initial value to a hexadecimal constant.
if (scanf("%x ",& amphex_val)! = EOF)
{
Printf ("its octal and decimal values are =%o, %d\n", hex_val, hex _ val, respectively);
}