A-A+

有以下程序: #include<iostream.h> Float fun(int x i

2022-08-05 21:15:08 问答库 阅读 172 次

问题详情

有以下程序: #include<iostream.h> Float fun(int x, int y) { return(x+y) ;} void main() { int a=2,b=5,c=8; cout < < fun((int) fun(a+c, b) ,a-c) ;} 程序运行后的输出结果是
A.编译出错
B.9
C.21
D.9.0

参考答案

正确答案:B
解析:本题的运算过程是fun((int) fun (a+c, b) ,a-c) ,fun((int) fun(10,5) ,2-8) ,fun ((int) 15.000000,-6) ,fun(15,-6) =9。

考点:程序