• 2021-04-14
    有如下程序:
    Const N=-5
    Const M=6
    Dim a(N To M)As Integer
    For i=LBound(a)To UBound(a)
    a(i)= i
    Next i
    Print a(LBound(a));a(UBound(a))
    运行后,输出结果为(  )。
  • -5 6

    内容

    • 0

      下列程序段的执行结果为________。 Dim M(10), N(10) i= 4 For j = 1 To 7 M(j) = j N(i) = 2 * i + j Next j Print N(i); M(i)

    • 1

      下列程序的运行结果为( )。 Private Sub Command1_Click() Dim a(5) As String Dim i As Integer For i = 0 To 5 a(i) = i + 1 Print a(i); Next i End Sub

    • 2

      运行下面的程序,第二行显示结果是___________。 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

    • 3

      已定义数组dim a(5) as integer,函数ubound(a())的值为________,lbound(a())的值为________

    • 4

      写输出下面程序的运行结果_ _。 Dim a() As Integer Private Sub Command1_Click() ReDim a(1 To 5) For i = 1 To 5 a(i) = i Next i ReDim a(1 To 10) For i = 6 To 10 a(i) = 2 * i Next i For i = 1 To 10 Print a(i); Next i End Sub