下列代码执行后,窗体上显示( )。 Dim x As Integer, y As Integer x = 50: y = 30 If x > y Then x = x - y Else y = y x If x < y Then x = x 20 Form1.Print x, y
举一反三
- 编写如下程序: 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 运行程序,输出结果为______
- 执行下列程序段后,变量y的值为( )。 Dim x As Integer,y As Integer x = 7 y = 3 If x >= 10 Then y = x - y ElseIf x>= 7 Then y = x + y Else y = x End If A: 21 B: 10 C: 4 D: 3
- 有如下事件程序,运行该程序后输出结果是。 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
- 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 则以下说法中正确的是( )。
- 中国大学MOOC: 下面的程序执行完后a,b的值分别为______。 Dim x, y, a, b As Integer x = 12 : y = 8 a = 1 : b = x * y Do While x Mod 2 = 0 And y Mod 2 = 0 x = x 2 y = y 2 a = a * 2 Loop Do While x <> y If x > y Then x = x - y Else y = y - x End If Loop a = a * x b = b a