执行如下语句后,x的值和输出结果分别是 ________。 int x=11; printf("%d", x+2);
A: 11 11
B: 12 12
C: 11 13
D: 12 13
A: 11 11
B: 12 12
C: 11 13
D: 12 13
举一反三
- 中国大学MOOC: 执行如下语句后,x的值和输出结果分别是 ________。int x=11; printf(%d, x+2);
- 有以下程序段:#include int main(){int x[ ] = {10, 20, 30}; int *px = x;printf("%d, ", ++*px); printf("%d, ", *px); px = x;printf("%d, ", (*px)++); printf("%d, ", *px); px = x;printf("%d, ", *px++); printf("%d, ", *px); px = x;printf("%d, ", *++px); printf("%d\n", *px);return 0;}程序运行后的输出结果是( ) A: 20, 10, 11, 10, 11, 10, 11, 10 B: 11, 11, 11, 12, 12, 20, 20, 20 C: 20, 10, 11, 20, 11, 12, 20, 20 D: 11, 11, 11, 12, 12, 13, 20, 20
- 有以下程序段:#include stdio.hint main(){int x[ ] = {10, 20, 30}; int *px = x;printf(%d, , ++*px); printf(%d, , *px); px = x;printf(%d, , (*px)++); printf(%d, , *px); px = x;printf(%d, , *px++); printf(%d, , *px); px = x;printf(%d, , *++px); printf(%d\n, *px);return 0;}程序运行后的输出结果是( )。 A: 11, 11, 11, 12, 12, 20, 20, 20 B: 20, 10, 11, 10, 11, 10, 11, 10 C: 11, 11, 11, 12, 12, 13, 20, 20 D: 20, 10, 11, 20, 11, 12, 20, 20
- 以下程序的输出结果是:main() { int a=12,b=12; printf(“%d %d ”,--a,b++); } A: 10 11 B: 11 13 C: 11 10 D: 11 12
- 已知x=12,y=10,执行语句“y=x>12?x+1:x-1;”后y的值为() A: 13 B: 11 C: 0 D: 10