11 lines
311 B
C
11 lines
311 B
C
|
// 请编程, 定义char类型的变量n,初始化值为-128, 将n值减1之后,再输出它的十六进制数值和十进制数值
|
|||
|
#include <stdio.h>
|
|||
|
|
|||
|
int main()
|
|||
|
{
|
|||
|
char n = -128;
|
|||
|
n -= 1;
|
|||
|
printf("十六进制数值为: 0x%hhx\n", n);
|
|||
|
printf("十进制数值为: %d\n", n);
|
|||
|
return 0;
|
|||
|
}
|