下列程序的输出结果为( ) void main() { int x, y, z; x = y = 1; z = x++, y++, ++y; printf(“%d, %d,下列程序的输出结果为( )void main(){ int x, y, z; x = y = 1; z = x++, y++, ++y; printf(“%d, %d, %d\n”, x, y, z);}选
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/29 03:54:24
下列程序的输出结果为( ) void main() { int x, y, z; x = y = 1; z = x++, y++, ++y; printf(“%d, %d,下列程序的输出结果为( )void main(){ int x, y, z; x = y = 1; z = x++, y++, ++y; printf(“%d, %d, %d\n”, x, y, z);}选
下列程序的输出结果为( ) void main() { int x, y, z; x = y = 1; z = x++, y++, ++y; printf(“%d, %d,
下列程序的输出结果为( )
void main()
{ int x, y, z;
x = y = 1;
z = x++, y++, ++y;
printf(“%d, %d, %d\n”, x, y, z);
}
选择一个答案
a. 2, 3, 3
b. 2, 3, 2
c. 2, 3, 1
d. 2, 2, 1
下列程序的输出结果为( ) void main() { int x, y, z; x = y = 1; z = x++, y++, ++y; printf(“%d, %d,下列程序的输出结果为( )void main(){ int x, y, z; x = y = 1; z = x++, y++, ++y; printf(“%d, %d, %d\n”, x, y, z);}选
c
首先赋值后,x=1,y=1
z = x++,y++,++y;
先执行z=x++=1,后面的y++,++y是逗号表达式,赋值优先级高于它
当输出后x=2,y=3;(x自加了一次,y自加了2次)