如下程序执行后,应用程序界面显示的是:
Dim a As Integer = 2
Dim b As Integer = 3
Dim c As Single = 2
If a < b Then
If a < c Then
c = c - 1
Else
c = c + 1
End If
End If
Label1.Text = c.ToString
Dim a As Integer = 2
Dim b As Integer = 3
Dim c As Single = 2
If a < b Then
If a < c Then
c = c - 1
Else
c = c + 1
End If
End If
Label1.Text = c.ToString
举一反三
- 如下程序执行后,应用程序界面显示的是: Dim a As Integer = 2...l1.Text = c.ToString
- 下列程序运算后,Label1结果显示的是: Dim x As Integer Dim S As String x = 20 S = "2020" x = x Mod 3 Select Case x Case 0 Label1.Text = "A" Case 1 Label1.Text = "B" Case 2 Label1.Text = "C" Case Else Label1.Text = "D" End Select
- 以下有关数组定义的语句序列中,错误的是 A: Static arrl(3) arr1(1)=100 arrl(2)="Hello" arrl(3)=123.45 B: Dim arr2()As Integer Dim size As Integer Private Sub Command2_Click() size=InputBOX(“输入:”) ReDim arr2(size) ┄ End Sub C: Option Base 1 Private Sub Command3_Click() Dim arr3(3)As Integer ┄ End Sub D: Dim n As Integer Private Sub Command4_Click() Dim arr4(n)As Integer ┄ End Sub
- 下面的数组声明语句中,正确的是_____。 A: Dim a[1,2] As Integer B: Dim a(1,2) As Integer C: Dim a[1] [2] As Integer D: Dim a(1 to 0,2 to 0) As Integer
- 运行下面的程序,第二行显示结果是___________。 Private Sub Form_Click() Dim A As Integer Dim i As Integer A = 5 For i = 1 To 9 Call sub1(i, A) Print i, A Next i End Sub Private Sub sub1(x As Integer, y As Integer) Static N As Integer Dim I As Integer For I = 3 To 1 Step -1 N = N + x x = x + 2 Next I y = y + N End Sub