[单选题]

设有如下程序:

Private Sub Form_Click()

D.im ary(1 To 5)As Integer

D.im i As Integer

D.im sum As Integer

F.or i=1 To 5

ary(j)=i+1

sum=sum+ary(i)

Next 1

Print sum

E.ud Sub

程序运行后,单击窗体,则在窗体上显示的是

A.15

B.16

C.20

D.25

参考答案与解析:

相关试题

设有如下程序:Private Sub Form_Click()Dim i As

[单选题]设有如下程序:Private Sub Form_Click()D.im i As Integer,x As String,Y As Stringx=”ABCDEFG”F.or i=4 To 1 Step-1y=Mid(x,i,i)+yNext iPrint yE.nd Sub程序运行后,单击窗体,输出结果为A.ABCCDEDEFGB.AABBCDEFGC.ABCDEFGD.AABBCCDDEEFFGG

  • 查看答案
  • 有如下程序: Private Sub Form_Click()Dim i As

    [单选题]有如下程序:Private Sub Form_Click()D.im i As Integer, Sum As IntegerSum=0F.or i=2 To 10If i Mod 2=0 And i Mod 3<>0 ThenSum=Sum+iE.nd IfNextPrint SumE.nd Sub程序运行后,单击窗体,输出结果为A.12B.30C.24D.18

  • 查看答案
  • 有如下程序:Private Sub Form_Click() Dim Check

    [单选题]有如下程序: Private Sub Form_Click() Dim Check,Counter Check=True Counter=0 Do Do While Counter<20 Counter=Counter+1 If Counter=10 Then Check=False Exit Do End If Loop Loop Until Check=False Print Counter,Check End Sub 程序运行后,单击窗体,输出结果为( )。A.15 0B.20 -1C.1

  • 查看答案
  • 有如下程序:Private Sub Form_Click() Dim Check

    [单选题]有如下程序: Private Sub Form_Click() Dim Check, Counter Check=True Counter=0 Do Do While Counter<20 Counter=Counter+1 If Counter=10 Then Check=False Exit Do End If Loop Loop Until Check=False Print Counter, Check End Sub 程序运行后,单击窗体,输出结果为______。A.15 0B.20

  • 查看答案
  • 有如下程序:Private Sub Form_Click() Dim i As

    [单选题]有如下程序: Private Sub Form_Click() Dim i As Integer, Sum As Integer sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then sum=sum+i End If Next i Print sum End Sub 程序运行后,单击窗体,输出结果为______。A.12B.30C.24D.18

  • 查看答案
  • 有如下程序:Private Sub Form_Click( )Dim i As

    [单选题]有如下程序: Private Sub Form_Click( ) Dim i As Integer, Sum As Integer Sum = 0 For i = 2 To 10 If i Mod 2< >0 And i Mod 3=0 Then Sum = Sum + i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为A.12B.30C.24D.18

  • 查看答案
  • 有如下程序:Private Sub Form_Click()Dim i As I

    [单选题]有如下程序:Private Sub Form_Click()D.im i As Integer,Sum As IntegerSum=0F.or i=2 To 10If i Mod 2<>0 And i Mod 3=0 ThenSum=Sum+iE.ndIfNextPrint SumE.nd Sub程序运行后,单击窗体,输出结果为A.12B.30C.24D.18

  • 查看答案
  • 有如下程序:Private Sub Form_Click()Dim i As I

    [单选题]有如下程序: Private Sub Form_Click() Dim i As Integer,Sum As Integer Sum=0 For i=2 To 10 If i Mod 2<>0 And i Mod 3=0 Then Sum=Sum+i End If Next Print Sum End Sub 程序运行后,单击窗体,输出结果为A.12B.30C.24D.18

  • 查看答案
  • 设有如下程序:Private Sub Form_Click()A=1For i=

    [单选题]设有如下程序: Private Sub Form_Click() A=1 For i=1 To 3 Select Case i Case 1,3 A=A+1 Case 2,4 A=A+2 End Select Next i Print A End Sub 程序运行后,单击窗体,则在窗体上显示的内容是A.6B.5C.4D.3

  • 查看答案
  • 设有如下程序:Private Sub Form_Click()Clsa$=”12

    [单选题]设有如下程序:Private Sub Form_Click()C.lsa$=”123456”F.or i=1 To 6Print Tab(12-i);_____Next iE.nd Sub程序运行后,单击窗体,要求结果如图所示,则在_____处应填入的内容为A.Left(a$,i)B.Mid(a$,8-i,i)C.Right(a$,i)D.Mia(a$,7,i)

  • 查看答案
  • 设有如下程序:Private Sub Form_Click()Dim ary(1