编写如下程序: 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 运行程序,输出结果为______
举一反三
- 有如下事件程序,运行该程序后输出结果是。 Private Sub Command33_Click() Dim x As Integer, y As Integer x = 1: y = 0 Do Until y <= 25 y = y + x * x x = x + 1 Loop MsgBox "x=" & x & ", y=" & y End Sub
- 有如下事件程序,运行该程序后输出结果是_________。 Private Sub Command33_Click() Dim x As Integer, y As Integer x=1:y=0 Do Until y<=25 y=y+x*x x=x+1 Loop MsgBox "x=" & x &",y=" & y End Sub A: x=1,y=0 B: x=4,y=25 C: x=5,y=30 D: 输出其他结果
- 下面程序运行后,点击窗体,变量 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
- 以下程序运行后的输出结果是 ______。 Sub add(x,y) x=x+y Print "x=";x;",y=";y End Sub Private Sub Command1_Click() x=1 y=1 Call add((x),(y)) Print"x="; x;",y=";y End Sub A: x=1,y=1 B: x=2,y=2 C: x=2,y=1 D: x=1,y=1 E: x=1,y=1 F: x=1,y=1 G: x=2,y=1 H: x=2,y=1
- 写出下列程序的运行结果。 Private Sub Form_Click() Dim x%, y% x = InputBox("请输入一个整数") If x <= 30 And x > 10 Then If x > 20 Then If x < 25 Then y = 10 Else y = 20 End If Else If x > 15 Then y = 30 Else y = 50 End If End If End If Print y End Sub 假设输入18,则运行结果为