单选题 C语言
题号 #2272909

有以下程序:   
#include<stdio.h>
int fun(int X,int y)
{if(X!=y)return((x+y)/2);
else return(x);
}
main(  )
{int a=4,b=5,c=6;
printf("%d/n",fun(2*a,fun(b,c)));
}
程序运行后的输入结果是(  )。

进入在线模考

参考答案

B

答案解析

此题考查的是函数fun(),fun(b,c)=5,然后fun(2*a,5)=fun(8,5)=6。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考