单选题 C语言
题号 #3276923

有以下程序:

程序执行后的输出结果是(    )。

进入在线模考

参考答案

A

答案解析

声明静态局部变量:函数调用结束后,其占用的存储单元不释放,在下次该函数调用时,该变量保留上一次函数调用结束时的值。本题子函数tim中的变量i和m均为静态局部变量。所以第一次调用fun函数,返回m的值为5,第二次再调用fun函数时,i的值为3,nl的值已经是5了,所以执行i+=m+1,i的值变为9,nl=i+x+Y=9+1+l=11。

你可能感兴趣的试题

A.auto和static
B.extern和register
C.auto和register
D.static和register
A.struct ord{int x;int Y;int z;}struct ord a;
B.struct ord{int x;im Y;im z;};struct ord a;
C.struct ord{int x;int Y;int Z;}a;
D.struct{int x;int Y;int z;}a;
找试题 · 找答案 · 找资料 在线模考