qfedu-c-level/day4/homework/h12.c

11 lines
311 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 请编程, 定义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;
}