网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下面程序的输出结果是【 】。

Private Sub Commandl_Click( )

Dim a(1 To 20)

Dim i

Fori = 1 To 20

a(i) = i

Next i

For Each i In a( )

a(i) = 20

Next i

Print a(2)

End Sub


参考答案

更多 “ 下面程序的输出结果是【 】。Private Sub Commandl_Click( )Dim a(1 To 20)Dim iFori = 1 To 20a(i) = iNext iFor Each i In a( )a(i) = 20Next iPrint a(2)End Sub ” 相关考题
考题 ( 10 )在窗体上有一个命令按钮 Commandl ,编写事件代码如下:Private Sub Command1_Click()Dim a(10), p(3) As Integerk = 5For i = 1 To 10a(i) = i * iNext iFor i = 1 To 3p(i) = a(i * i)Next iFor i = 1 To 3k = k + p(i) *2Next iMsgBox kEnd Sub打开窗体运行后,单击命令按钮,消息框中输出的结果是 【 10 】 。

考题 设有命令按钮Command1的单击事件过程,代码如下:Private Sub Command1_Click()Dim a(3,3)As IntegerFor i=1 To 3For j=1 To 3a(i,j)=i*j+iNext jNext iSum=0For i=1 To 3Sum=Sum+a(i,4-i)Next iPrint SumEnd Sub运行程序,单击命令按钮,输出结果是( )。A.20B.7C.16D.17

考题 ( 22 )命令按钮 Command1 的单击事件过程的代码如下:Private Sub Command1_Click( )Dim a(3 , 3)As IntegerFor i=1 To 3For j=1 To 3a(i , j)=i*j+iNext jNext iSum=0For i=1 To 3Sum=Sum+a(i , 4-i)Next iPrint SumEnd Sub运行程序,单击命令按钮,输出结果是( )。A ) 20B ) 7C ) 16D ) 17

考题 下列程序的输出结果是______。Private Sub Command1_Click()Dim arr(1To 10)For i=1 To 10arr(i)=iNext iFor Each i In arr()arr(i)=arr(i)*2+1Next iMsgBox arr(7)End Sub

考题 阅读程序: Sub p( b () As Integer)For i =1To 4 b(i) = 2(iNext i End Sub Private Sub Command1_Click()Dim a (1 To 4) As Integer a(1)=5 a(2)=6 a(3)=7 a(4)=8 call p (a) For i=1 To 4 Print a(i) Next iEnd Sub运行上面的程序,单击命令按钮,输出结果为。

考题 下面运行程序后,单击命令按钮,输出的结果是 【 】 。Private Sub Command1_Click()Dim a%(1 To 5),i%, s#For i=1 To 5a(i)=iNexts=Fun(a)Print "s="; s;End SubFunction Fun(a() As Integer)Dim t#, i%t=1For i=LBound(a) To UBound(a)t=t  a(i)NextFun=tEnd Function

考题 下列程序的输出结果是【 】Private Sub Command1_Click()Dim a(1 To 20)Dim iFor i=l To 20a(i)=iNext iFor Each i In a()a (i) =20Next i

考题 在窗体上有一个命令按钮Commandl,编写事件代码如下:Private SuB commandl_Click()Dim a(10),p(3)As Integerk=5For i=1 To 10a(i)=i+iNext iFor i=1 To 3P(i)=a(i*i)Next iFor i=1 To 3k =k+p(i)*2Next iMsgBox kEnd SuB打开窗体运行后,单击命令按钮,消息框中输出的结果是【 】。

考题 在窗体画一个命令按钮,然后编写如下事件过程:Private Sub Command1_CIick()Dim a(1 To 10)Dim p(1 To 3)k=5For i =1 To 10a(i)=iNext iFor i=1 To 3p(i)=a(i*i)Next iFor i=1 To 3k=k+p(i)*2Next iPrint kEnd Sub程序运行后,单击命令按钮,输出结果是【 】。

考题 有如下程序: Private Sub Commandl_Click( ) Dim i As Integer For i=1 To 2 DS Next i End Sub Sub DS( ) Dim x As Integer,m As String Static y,n X=X + 1 y=y + 1 m=m "*”:n=n"#" Print x,y,m,n End Sub 程序运行后,输出的结果是A.1 1 * #B.1 1 * #C.1 1 * # 1 1 * # 1 2 * #D.1 1 * # 1 1 * ## 1 2 * ##

考题 设有如下程序: Private Sub search(a()As Variant,ByVal key As Variant,index%) Dim I% For I = Lbound(a)To Ubound(A)If key=a(I)Then index=I Exit Sub End If Next I index=-1 End Sub Private Sub Form_Load() Show Dim b()As Variant Dim n As Integer b=Array(21,64,92,15,72,38,45,72) Call search(b, 45, n) Print n End Sub 程序运行后,输出的结果是A.2B.6C.10D.12

考题 下面程序段,运行后的结果是 Private Sub Commandl_Click( ) Dim b%(1 To 4),i%,t# For i=1 To 4 b(i)=i Next i t=Tof(b( ) ) Print"t=";t, End Sub Function Tof(a() As Integer) Dim t#,i% t=1 For i=2 To UBound(A)t=t * a(i) Next i Tof=t End FunctionA.t=18B.t=24C.t=30D.t=32

考题 下列程序的输出结果是【 】。Private Sub Command l Click()Dim a(1 TO 20)Dim iFor i=1 TO 20a(i)=iNext iFor Each i In a()a(i)=20Next iPrint a(2) End Sub

考题 下列程序的输出结果是【 】。Private Sub Command1_Click()Dim a(1 To 20)Dim iFor i=1 To 20a(i)=iNext iFor Each i In a()a(i)=20Next iPrint a(2)End Sub

考题 执行下面的程序,消息框的输出结果是 【 】。Option BaselPrivate Sub Commandl Click()Dim a(10),P(3)As Integerk=5For i=1 To 10a(i)=iNext iFor i=1 To 3P(i)=a(i*i)Next iFor i=1 To 3k=k+p(i)*2Next iMsgBox kEnd sub

考题 执行下面的程序,消息框的输出结果是( )。Dim a(1 To 10),b(1 To 5)As Integersum=0For i=1 To 10Next iFor i=1 To 5Next iFor i=1 To 5Next iMsgBox sum

考题 执行下面的程序,消息框的输出结果是【 】。Option Base1Private Sub Command1_Click( )Dim a(10),P(3)As Integerk=5For i=1 To 10a(i)=iNext iFor i=1 To 3P(i)=a(i*i)Next iFor i=1 To 3k=k+p(i)*2Next iMsgBox kEnd sub

考题 有如下的程序。 Private Sub Commandl_Click( ) Dim k As Integer, m As Integer Dim P As Integer k=4: m=1 P=Fun(k, m) : Print P; P = Fun ( k, m) : Print P End Sub Private Function Fun( a As Integer, b As Integer) Static m As Integer, i As Integer m=5:i=2 i=i+m+1 m=i + a + b Fun=m\2 End Function 单击命令按钮后,输出结果为A.2 2B.4 4C.5 5D.6

考题 下列程序的输出结果是______。Private Sub Commandl_Click()Dim alt(1 To 10)Fori=1 To 10arr(i) =INext iFor Each i In arr()arr(i) =arr(i) *2+1Next iMsgBox arr(7)End Sub

考题 有下列程序,程序运行后单击命令按钮,则输出的结果是( )。Private Sub Command1_Click()Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2#For i=1 To 4a(i)=iNext iFor i=3 To 6b(i)=iNext is1=Factorial(A)s2=Factorial(B)Print"s1=";s1;"s2=";s2End SubFunction Factorial(a() As Integer)Dim t#,i%t=1For i=LBound(A)To UBound(A)t=t*a(i)Next iFactorial=tEnd FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360

考题 阅读程序: Function fac(ByVal As Integer)As Integer Dim temp As Integer temp=1 For i%=1 To n temp=temp*i% Next i% fac=temp End Function Private Sub Form. Click( ) Dim nsum As Integer nsum=1 For i%=2 T0 4 nsum=nsum+fac(i%) Next i% Print nsum End Sub 程序运行后,单击窗体,输出结果是( )。A.35B.31C.33D.37

考题 下列程序的输出结果是______。Private Sub Command1_Click()Dim arr(1 To 10)For i=l TO 10arr(i)=iNext iFor Each i In arr()art(i)=arr(i)*2+1Next iMsgBox arr(7)End Sub

考题 下列程序的输出结果是( )。Private Sub Command1_Click()Dim arr(1 To 10)For i=1 To 10Next iFor Each i In arr()Next iEnd Sub

考题 单击窗体时,下列程序的执行结果是 Private Sub Invert(By Val xstr As String,ystr As String) Dim tempstr AS String Dim I AS Integer I=Len(xstr) Do While I>=1 tempstr=tempstr + Mid(xstr,I,1) I=I - 1 Loop ystr=tempStr End Sub Private Sub Form_Click( ) Dim s1 As String,s2 As String S1="abcdef" Invert S1,S2 Print S2 End SubA.abcdefB.afbecdC.fedcbaD.defabc

考题 运行下列程序:Private Sub Command1_Click( )Dim A(10) As IntegerFor i = 1 To 5A(i) = iA(i + 5) = iNext iFor i = 1 To 10s = s + A(i)Next iDebug.Print sEnd Sub单击按钮后,则在立即窗口内显示的结果是( )。A.5B.10C.30D.出错信息

考题 下面程序运行后,单击命令按钮,输出的结果是______。Private Sub Command1_Click()Dim a%(1 To 5),i%,sFor i=1 To 5a(i) =iNexts=Fun(A)Print "s=";s;End SubFunction Fun(a() As Integer)Dim t,i%t=1For i=LBound(A)To UBound(A)t=t*a(i)NextFun=tEnd Function

考题 在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Commandl_Click()Dim a (1 To 10)Dim p(1 To 3)k=5For i=1 To 10a(i)=iNextiFori=1 To 3p(i)=a(i*i)Next iFor i=1 To 3k=k+p(i)*2Next iPrint kEnd Sub程序运行后,单击命令按钮,输出结果是【 】。