当前位置:IT认证>BASIC题库

问题:[填空题]

[填空题] 窗体上有名称为Command1的命令按钮。事件过程及2个函数过程如下: Private Sub Command1_Click() Dim x As Integer,y A8 Integer,z X=3 y=5 z=fy(y) Print fx(fx(x)),y End Sub Function fx(ByVal a As Integer) a=a+a fx=a End Function Function fy(ByRef a As Integer) a=a+a fy=a End Fun

  

参考答案:

[12]12[13]10

  参考解析

 函数fy中的参数a是按地址传递,函数fx中的参数a是按值传递,所以执行z=fy(y)后,y的值为10,z的值为10,x的值为3;而执行fx(fx(x))后,fx(fx(x))的值为12。

微信端