下面程序运行后,点击窗体,变量 x和y的值分别为( )、( ) Private Sub Form_Click() Dim x, y As Integer x = 5: y = 10 nc x, y Print "x="; x; "y="; y End Sub Private Sub nc(ByVal a%, b%) a = a + b b = a a = a * b End Sub
举一反三
- 设有如下两个过程: Private Sub Form_Click() Dim x!,y! x = 18: y = 10 Call PPP((x), y) Print x,y End Sub Private Sub PPP(a As Single, b As Single) a = a + b Print a,b b = a + b Print a,b End Sub 运行程序后, 则输出结果是________
- 窗体上有标签(Label1、Label2)和命令按钮(Command1),编写如下事件过程: Private x As Integer: Private Sub Command1_Click(): Dim x As Integer, y As Integer: x = 5: y = 3: proc x, y: Label1.Caption = x: Label2.Caption = y: End Sub: Private Sub proc(ByVal a As Integer, b As Integer): x = a + b: b = b * b: End Sub:运行后,单击按钮,Label1和Label2将分别显示
- 编写如下程序: Private Sub Command1_Click() Dim x As Integer, y As Integer x = 1: y = 1 Do y = x * y If y > 10 Then Print x, y Exit Do Else x = x + 3 End If Loop While x <= 10 End Sub 运行程序,输出结果为______
- 在窗体上添加一个命令按钮,程序运行时单击Commandl后,窗体上的输出结果为。 Private Sub fun(a%, ByVal b%) a=a*2:b=b*2 End Sub Private Sub Command1_Click() Dim x%,y% x=10:y=20 Call fun(x, y) Print x; y End Sub
- Sub s1(ByVal x As Integer, ByVal y As Integer) Dim t As Integer t = x: x = y: y = t End Sub Sub s2(x As Integer, y As Integer) Dim t As Integer t = x: x = y: y = t End Sub 则以下说法中正确的是( )。