单选题
C语言
题号 #2272910
有以下程序:
#include<stdio.h>
int fun( )
{static int x=1;
X*=2:
return x;
}
main( )
{int i,S=1;
for(i=1;i<=3;i++)S*=fun( );
printf("%d\n",s);
}
程序运行后的输出结果是( )。
参考答案
D
答案解析
函数fun()是2的次方的运算,而s*=fun(),所以答案为64。
你可能感兴趣的试题
A.197
B.143
C.33
D.28
A.t1=t2;
B.t2.num1=t1.num1;
C.t2.mark=t1.mark;
D.t2.num2=t1.num2;