A-A+

请读程序: #include <stdio.h> func(int a int b) {

2022-08-06 03:35:35 问答库 阅读 175 次

问题详情

请读程序: #include <stdio.h> func(int a, int b) { int c; c=a+b; return c; } main() { int x=6,y=7,z=8,r; r=func((x--,y++,x+y),z--); printf("%dn",r); 上面程序的输出结果是()。
A.11
B.20
C.21
D.31请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:C
解析:函数func的作用是返回两个形参的和,第一个形参是x,y分别自减和自增后的和13,第二个形参的值为8(根据语法规则,应当先使用,后自增),所以func的返回值为13+8=21。

考点:程序