有如下程序 #include<iostream.h> int func(int a,int b) {return(a+b);} void main() { int x=2,y=5,z=8,r; r=func (fun

admin2010-03-29  23

问题 有如下程序    #include<iostream.h>    int func(int a,int b)    {return(a+b);}    void main()    { int x=2,y=5,z=8,r;      r=func (func (x,y),z);      cout<<r;    该程序的输出的结果是

选项 A、12
B、13
C、14
D、15

答案8

解析 语句r=time(func(x,y),z);中, fun(x,y)是一次凋用函数,它的值作为func另一次调用的实参。注意本题调用两次函数。
转载请注明原文地址:https://kaotiyun.com/show/ARjp777K
0

最新回复(0)