编写如下程序: Private Sub Command1_Click() Dim x As Integer, y As Integer x = 10 y = 20 Call fun1(x, y) Print x; y End

admin2018-09-19  21

问题 编写如下程序:
Private Sub Command1_Click()
   Dim x As Integer, y As Integer
   x = 10
   y = 20
   Call fun1(x, y)
   Print x; y
End Sub
Private Function fun1(ByVal m As Integer, n As Integer) As Integer
   m = m * m
   n = n + n
End Function
程序运行后,单击命令按钮Command1,输出结果为

选项 A、10   25
B、10   40
C、100   25
D、100   40

答案B

解析 函数fun1(ByVal m As Integer, n As Integer)中m通过ByVal指定为值传递,n为引用传递。传递给该函数的实参会被改变。选B)。
转载请注明原文地址:https://kaotiyun.com/show/RbFp777K
0

最新回复(0)