有以下程序 #include<stdio.h> main() int f(int x,int y) {int a=3,b=4,c=5,d; {return((y-x)*x);} d=f(f(a,b),f(a,c)); printf("%d\n",

admin2019-08-18  22

问题 有以下程序
#include<stdio.h>  main()
int f(int x,int y)  {int a=3,b=4,c=5,d;
{return((y-x)*x);}  d=f(f(a,b),f(a,c));
  printf("%d\n",d);}
程序运行后的输出结果是

选项 A、10
B、8
C、9
D、7

答案C

解析 本题考查函数的嵌套调用。首先计算f(a,b)与f(a,c),f(a,b)=(b-a)*a=3,f(a,c)=(c-a)*a=6,然后计算f(3,6)=(6-3)*3=9。
转载请注明原文地址:https://kaotiyun.com/show/cZRp777K
0

相关试题推荐
最新回复(0)