全部题库 / C语言 / 试题详情
单选题 C语言
2013-08-15

有以下程序:
#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);
}
程序运行后的输出结果是(  )。

A.0   
B.10   
C.30
D.64

参考答案

D

答案解析

函数fun()是2的次方的运算,而s*=fun(),所以答案为64。

你可能感兴趣的试题