假定有如下的Sub过程: Sub Func(x As Single, y As Single) t=x x=t/y y=t Mod y End Sub 在窗体上画一个命令按钮,然后编写如下事件过程:

admin2010-09-11  21

问题 假定有如下的Sub过程:    Sub Func(x As  Single,  y As  Single)      t=x      x=t/y      y=t Mod y    End Sub    在窗体上画一个命令按钮,然后编写如下事件过程:    Private Sub Command1_Click()    Dim a As Single    Dim b As Single    a=6    b=5    Func(a, B)    Print a, b    End Sub    程序运行后,单击命令按钮,输出结果为 ______。

选项 A、6  5
B、1  1
C、1.2  5
D、1.2  1

答案8

解析 Visual Basic的函数参数默认的方式是传地址的,所以函数s对参数做的改变会反映到原来的变量里。
转载请注明原文地址:https://kaotiyun.com/show/Pymp777K
0

最新回复(0)