当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

(34)有以下程序#include <stdio.h>int fun(){ static int x=1;x*=2;return x;}main(){ int


(34)有以下程序

#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 ",s);

}

程序运行后的输出结果是

A)0

B)10

C)30

D)64

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题
  • 请阅读下述代码,写出程序执行的结果#include &lt;iostream&gt; using namespace std; class C

  • 请阅读下述代码,写出程序执行的结果#include &lt;iostream&gt; using namespace std; class C

  • 有以下程序:include&lt;stdio.h&gt;main(){ char*s=&quot;[2]34&quot;;int k=0,a=0; whil(s[k+

  • (34 )有以下程序#include &lt;stdio.h&gt;int fun (){ static int x=1;x*2; return x;}main (){

  • (34 )有以下程序#include &lt;stdio.h&gt;int fun (){ static int x=1;x*2; return x;}main (){

  • 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;main(){ printf("%d ",strlen (