[单选题]

有如下程序: 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.12

B.30

C.24

D.18

参考答案与解析:

相关试题

有如下程序: 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 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() 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

    [单选题]设有如下程序: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 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 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 ary(1

    [单选题]设有如下程序:Private Sub Form_Click()D.im ary(1 To 5)As IntegerD.im i As IntegerD.im sum As IntegerF.or i=1 To 5ary(j)=i+1sum=sum+ary(i)Next 1Print sumE.ud Sub程序运行后,单击窗体,则在窗体上显示的是A.15B.16C.20D.25

  • 查看答案
  • 有如下程序::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()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() Dim i As