有以下程序: #include<stdio.h> main() {intx=0xg; pfinff("%c\n",’A’+x); } 程序运行后的输出结果是( )。

admin2021-07-09  42

问题 有以下程序:
#include<stdio.h>
main()
{intx=0xg;
pfinff("%c\n",’A’+x);
}
程序运行后的输出结果是(    )。

选项 A、I
B、J
C、K
D、H

答案B

解析 printf("%c\n",’A’+x),x=0x9(16)转为十进制x=9,因此printf("%c\n",’A’+9),打印格式要求是%c,因此需要从字符A,按字母顺序向后偏移9个位置,可得结果为J。故答案为B选项。
转载请注明原文地址:https://kaotiyun.com/show/xokp777K
0

随机试题
最新回复(0)