编写如下程序: Prirate 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 f

admin2016-06-23  40

问题 编写如下程序:
Prirate 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://jikaoti.com/ti/eNkiFFFM
0

最新回复(0)