编写如下程序: Private Sub Command1_Click() Dim x As Integer x=10 Print fun1(x,12)+x End Sub Private Function fun1(m As Integer,n As In

admin2020-04-18  18

问题 编写如下程序:
Private Sub Command1_Click()
Dim x As Integer
x=10
Print fun1(x,12)+x
End Sub
Private Function fun1(m As Integer,n As Integer)As Integer
If n>10Then m=n
fun1=m+n
End Function
程序运行后,单击命令按钮Command1,输出结果为(    )。

选项 A、30
B、32
C、34
D、36

答案D

解析 function fun1函数中的参数都是引用传递,会改变实参的值,执行完后Command1_Click中变量x的值为12。选D)。
转载请注明原文地址:https://jikaoti.com/ti/U1x0FFFM
0

随机试题
最新回复(0)