设执行以下程序段时依次输入2,4,6,执行结果为Dim a(4)As IntegerDim b(4)AS IntegerFor k=0 To 2a(k+1)=Val(InputBox("Enter data:"))b(3 - k) =a(k + 1)Next kPrint b(k)A.2B.4C.6D.0

设执行以下程序段时依次输入2,4,6,执行结果为

Dim a(4)As Integer

Dim b(4)AS Integer

For k=0 To 2

a(k+1)=Val(InputBox("Enter data:"))

b(3 - k) =a(k + 1)

Next k

Print b(k)

A.2

B.4

C.6

D.0


相关考题:

在窗体上添加一个命令按钮控件,名为Command1,事件过程如下,则执行结果是 Option Base 1 Private Sub Command1_Click() Dim a(5)As Integer Dim k As Integer Dim total As Integer a(1) = 2 a(2) = 5 a(3) = 4 a(4) = 10 a(5) = 6 For k = 1 To 5 Total = total + a(k) Next k Print total End SubA. 10 B.15 C. 27 D. 35

下列程序段的执行结果为 ______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim x As Integer For i=1 To 3 m(i,i)=i Next For i=0 To 3 For j=0 To 3 x=x+m(i,j) Next Next Print xA.3B.4C.5D.6

有如下程序段: Dim I As Integer I=Int(-3.25)执行后,I的返回值是A.-3B.-4C.3D.3.25

单击命令按钮时,下列程序代码的执行结果为( )。 Private Function FirProc(x As Integer,y As Integer,z As Integer) FirProc=2*x+y+3*z End Funcfion Private Function SecProc(x As Integer,y As Integer,z As Integer) SecProc=FirProc(z,x,y)+x End Funcfion Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer a=2 b=3 c=4 Printf SecProc(c,b,a) End SubA.21B.19C.17D.34

执行以下程序段后,x的值为( )。 Dim x As Integer,i As Integer x=0 For i=20 To 0 Step -2 x=x+i\5 Next iA.16B.17C.18D.19

(28)阅读下列程序: Private Sub Commandl_Click() Dim i As Integer,k As Integer k=2 For i=1 To 3 PrintH(K); Next i End Sub Function H(j As Integer) Static b a=0 a=a+1 b=b+1 H=a*b+jEnd Function 单击命令按钮,执行程序,输出结果是A.2 3 4 B.3 4 5 C.5 6 7 D.3 5 6

设执行以下程序段时依次输入2,4,6执行结果为 Dim a(4) As Integer,b(4) As Integer For k =0 To 2 a(k + 1) = Val(InputBox( "Enter data:" ) ) b(3 - k) =a(k + 1) Next Print b(k)A.2B.4C.6D.0

有如下程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim p As Integer k=4:m=1 p=PC(k,m):Print p; p=PC(k,m):Print p End Sub Private Function PC(a As Integer,b As Integer) Static m As Integer,i As Integer m=0:i=2 i=i + m + 1 m=i + a + b PC=m End Function 程序运行后,输出的结果为A.4 6B.6 6C.8 8D.10 12

单击命令按钮,并在对话框内依次输入5,7,6下列程序段的执行结果为______。 Private Sub Command1_Click() Dim n AS Integer, a As Integer, b As Integer, c As Integer n = 0 For i = 1 To 3 a = InputBox ("请输入数字") n = n+a*a If n > 50 Then GoTo ex End If Next i ex: Print n End SubA.25B.74C.85D.110

以下程序段的执行结果是 ______。 Dim a As Integer,b As Integer For a=4 To 1 Step-1 b=b+a Next a Print b, aA.100B.9 1C.10 1D.90

在一个窗体上添加命令按钮控件,名为Command1,事件过程如下,则该过程的执行结果为______。Option Base 1Private Sub Command1_ Click() Dim a(5)As Integer Dim k As Integer Dim Total As Integer a (1)= 2 a (2)= 5 a (3)= 4 a (4)= 10 a (5)= 6 for k =1 To 5 Total = Total +a(k) Next k Print TotalEnd SubA.10B.15C.27D.35

执行下列程序后,变量a的值为 ( ) Dim i As Integer Dim a As Integer a=0 For i=l To 100 Step 2 a=a+l Next iA.1B.10C.50D.100

有如下程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim op As Integer k=4:m=1 p=PPC(k,m):Print op; p=PPC(k.m):Print op End Sub Private Function PPC(a As Integer,b As Integer) Static m As Integer,i As Integer m=0:i=2 i=i+m+1 m=i+a+b PPC=m End Function 程序运行后,输出的结果为A.4 6B.6 6C.8 8D.10 12

单击命令按钮时,下列程序段的执行结果为( )。 Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a-2:b=4:c=6 Call S1(a,b)Print "a="; a; "b="; b; "c="; c Call S2(a,b)Print "a ="; a; "b="; b; "c="; c; End Sub Private Sub S1(x As Integer, y As Integer) Dim c As Integer x=2*x:y=y+2:c=x+y End Sub Sub S2(x As Integer, ByVal y As Integer) Dim e As Integer x=2*x:y=y+2:e=x+y End SubA.a=4 b=6 c=6 a=4 b=6 c=6B.a=8 b=6 c=6 a=8 b=6 c=6C.a=4 b=6 c=6 a=8 b=6 c=6D.a=8 b=6 c=6 a=4 b=6 c=6

执行以下程序段 Dim x As Integer, i As Integer x=0 For i=20 To Step -2 x=x+i\5 Next i 后,x的值为A.16B.17C.18D.19

有如下的程序: Private Sub Command1_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 in=5:i=2 i=i+m+1 m=i+a+b Fun=m\2 End Function 单击命令按钮后,输出结果为A.2 2B.4 4C.5 5D.6 6

23 有如下程序段,该程序段循环的次数是______。 Dim i As Integer Dim j As Integer Dim k As Integer k=0 For i = 0 To 10 Step 3 For j = 1 To 5 If j > 3 Then k = k + 4: Exit For k=k+1 Print k Next j If i > 8 Then Exit For Next iA.9B.10C.11D.12

执行下列程序段时,分别在输入框中输入2、4、6,则执行结果是______。 Dim A(4) As Integer Dim B(4) As Integer For i = 0 To 2 A(i + 1) = Val (InputBox (“请输入数据”)) B(3 - i) = A(i + 1) Next i Print B(i)A.2B.4C.6D.8

单击一次命令按钮之后,下更程序代码的执行结果为______ 。 Public Sub Proc(a() As Integer) Static i As Integer Do a(i) = a(i) + a(i + 1) i=i+1 Loop While i < 2 End Sub Private Sub Command1_Cliek() Dim m As Integer Dim i As Integer Dim x(10) As Integer For i = 0 To 4 x(i) = i + 1 Next i For i = 1 To 2 Call Proc (x) Next i For i = 0 To 4 Print x(i); Next i End SubA.3 4 7 5 6B.3 5 7 4 5C.1 2 3 4 5D.1 2 3 5 7

程序段如下: Dim i As Integer,s As Integer For i=4 To 1 Step-1 s=s+i Next i Print s,i执行的结果是( )。A.10 0B.9 1C.10 1D.9 0

有如下函数:Private Function firstfunc(x As Integer, y As Integer) As Integer Dim n As Integer Do While n <= 4 x=x +y n=-+1 Loop firstfunc = x End Function调用该函数的事件过程如下:Private Sub Command1_lick() Dim x As Integer Dim y As Integer Dim n As Integer Dim z As Integer x=1 y=1 For n = 1 To 3 z = firstfunc(x, y) Next n Print z End Sub该事件过程的执行结果是 ______。A.1B.3C.16D.9

设执行以下程序段时依次输入1、3、5,执行结果为______ 。 Dim a(4)As Integer Dim b(4) As Integer For K=0 To 2 a(K+1)=Val(1nputBox(“请输入数据:”)) b(3-K)=a(K+1) Next K Print b(K)A.1B.3C.5D.0

在一个窗体上添加一命令按钮控件,名为Command1,事件过程如下,则该过程的执行结果是( )。 option base 1 Private Sub Command1_Ctick() Dim a (5) As Integer Dim k As Integer Dim total As Integer a(1)=2 a(2)=5 a(3)=4 a(4)=10 a(5)=6 For k=1 To 5 total=total+a(k) Next k Print total End SubA.10B.15C.27D.35

在一个窗体上添加一个命令按钮控件,名为Command1,事件过程如下,则执行结果是( )。 Option Base 1 Private Sub Command1_Cliek() Dim a(5) As Integer Dim k As Integer Dim tota1 As Integer a(1)=2 a(2)=5 a(3)=4 a(4)=10 a(5)=6 Fork=1 To 5 tota1=tota1+a(k) Next k Print total End SubA.10B.15C.27D.35

下列程序段的执行结果为______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim x As Integer For i=1 To 3 m(i,i)=i Next For i=0 T0 3 For j=0 To 3 x=x+m(i, j) Next Next Print xA.3B.4C.5D.6

下列程序段的执行结果为 ______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim K As Integer For i=1 To 3 m(i,i)=i Next For i=0 To 3 For j=0 To 3 x=x+m(i,j) Next Next Print xA.3B.4C.5D.6

下列程序打印结果为 ______。Private Sub Command1_ Click() Dim a(5)As String Dim b As Integer Dim i As Integer for i = 0 To 5 a(i)= i +1 Print a(i); Next iEnd SubA.12345B.6C.1 2 3 4 5 6D.0