单击命令按钮执行以下程序,输出结果为( )。 Private Sub Commandl—Click() Dim x As Integer,Y As Integer x=12:y=32 Call Proc(x,y)

admin2019-03-14  16

问题 单击命令按钮执行以下程序,输出结果为(    )。
    Private Sub Commandl—Click()
    Dim x As Integer,Y As Integer
    x=12:y=32
    Call Proc(x,y)
    Print x;y
    End Sub
    Public Sub Proc(n As Integer,ByVal m As Integer)
    n=n Mod 10:m=m Mod 10
    End Sub

选项 A、12 32
B、2 32
C、2 3
D、12 3

答案B

解析 本题考查过程调用中的参数传递。参数传递时默认为地址传递,如果实参为常量或者形参加上ByVal关键字说明,则为传值传递。本题中第一个参数为地址传值传递,第二个参数为传递,因此调用以后x值为2,而y不变。
转载请注明原文地址:https://kaotiyun.com/show/n7Fp777K
0

最新回复(0)