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

admin2020-07-22  22

问题 编写如下程序:
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 > 10 Then 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://kaotiyun.com/show/P3Hp777K
0

最新回复(0)