首页/ 题库 / [单选题]下列程序段的执行结果为______。 D的答案

下列程序段的执行结果为______。 Dim A(10),B(5) For i=1 To 10 A(i)=i Next i For j=1 To 5 B(j)=j*20 Next j A(5)=B(2) Print"A(5)="; A(5)

单选题
2022-02-21 16:25
A、A(5)=5
B、A(5)=10
C、A(5)=20
D、A(5)=40
查看答案

正确答案
D

试题解析
解析:观察程序段,可知程序段最终的输出结果是字符串“A(5)=”和数组元素A(5)的值。由程序段可知:A(5)=B(2),根据程序段中以J为循环变量的循环可得:B(2)=2*20=40,则A(5)=40。

标签:
感兴趣题目
下列程序段的执行结果为 ______。 Dim A(10),B(5) For i=1 To 10 A(i)=i Next i For i=1 To 5 B(j)=j*20 Next i A(5)=B(2) Print=A(5)= ";A(5)
下列程序段的执行结果为______。 Dim A(10),B(5) For i=1 To 10 A(i)=i Next i For j=1 To 5 B(j)=j*20 Next j A(5)=B(2) Print"A(5)="; A(5)
下列程序段的执行结果为 ______。 Dim A(10),B(5) For i=1 To 10 A(i)=i Next i For j=1 To 5 B(j)=j*20 Next j A(5)=B(2) Pring"A(5)=";A(5)
下列程序段的执行结果为______。 DimA(10),B(5) For i=1 To 10 A(i+=i Next i For i=1 To 5 B(j)=j*20 Nextj A(5)=B(2) Pfiat"A(5)";A(5)
在窗体上画一个名称为Connand1的命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim i As Integer, j As Integer Dim a(10, 10) As Integer For i = 1 To 3 For j = 1 To 3 a(i, j) = (i - 1) * 3 + j Print a(i, j); Next j Print Next i End Sub程序运行后,单击命令按钮,窗体上显示的是______。
下列程序段的执行结果为______。 Dim M(10), N(10) I=3 For T = 1 To 5 M(T) = T N(I) = 2 * I + T Next T Print N(I); M(I)
下面的程序段执行后,X的结果为______。 X=0 For I=1 to 5 For j=I to 5 X=X+1 Next j Next I Print x
下列程序段的执行结果为______。 A=0: B=0 For I=-1 To -2 Step-1 For J=1 To 2 B=B+1 Next J A=A+1 Next I Print A; B
下列程序段的执行结果为 ______。A=0:B=0For I = -1 To -2 Step -1 For J = 1 To 2 B=B+1 Next J A=A+1Next IPrint A; B
以下程序段的执行结果是 ______。 Dim a As Integer,b As Integer For a=4 To 1 Step-1 b=b+a Next a Print b, a
下列程序的运行结果是 ______。Private Sub Command1_ Click () a =1: b=1 for i = 1 To 3 a= a+ b: b=b+ a Next i Print a, bEnd Sub
单击一次命令按钮之后,窗体中的输出结果为______。 Private Sub Command1_ Click() Dim a As Integer, b As Integer For i = 1 To 6 a=i*i+i Next i Call writein(a,B)Print a, b End Sub Sub writein(a, ByValB)b = 1 For i = 1 To 6 a=b* 4 b = b + 1 Next i End Sub
相关题目
以下程序的输出结果是______。 main() { int i,k,a[10],p[3] k=5; for(i=0;i<10;i++)a[i]=i for(i=0;i<3;i++)p[i]=a[i*(i+1)]; for(i=0;i<3;i++)k+=p[i]*2; printf("%d ",k); }
下列程序的输出结果是______。 main() { int i,k,a[10],p[3]; k=5; for (i=0;i<10;i++) a[i]=i for (i=0;i<3;i++) p[i]=a[i*(i+1)]; for (i=0;i<3;i++)k+=p[i]*2; printf("%d ",k); }
以下程序的输出结果是______。 main() { int i,a[10]; for(i=9;i>=0;i--)a[i]=1O-i; printf("%d%d%d",a[2],a[5],a[8]); }
下列程序段的执行结果为 ______。 I=0 For G=10 To 19 Step 3 I=I+1 Next G Print I
下列程序段的执行结果为______。 I=0 For G=10 To 19 Step 3 I=I+1 Next G Print I
下列程序执行后,执行的结果是______ 。 Dim M(2) For i = 1 To 2 M(i) = 0 Next i k=2 For i = 1 To k For j = 1 To k M(j) = M(i) + 1 Print M(k): Next j Next I
在窗体上添加如下命令按纽,然后编写如下事件过程: Private Sub Command1_Click() Dim a(10)As Integer Dim p(3)As Integer k= 5 For i = 1 To 10 a(i) = i Next i For i = 1 To 3 p(i) = a(i * i) Next i For i = 1 To 3 k = k + p(i) * 2 Next i Print k End Sub该过程的运行结果为______。
下面程序:________Option Base 1Private Sub Command1_Click() Dim a(10),p(3)As Integer Dim i,k As Integer k=5 For i=1 To 10 a(i)=i Next For i=1 To 3 p(i)=a(i*i) Next For i=1 To 3 k=k+p(i)*2 Next Print kEnd Sub运行后的输出结果为________。
下列程序段的执行结果为______。 K=0 For J = 1 To 2 For I = 1 To 3 K=I+1 Next I For I = 1 To 7 K=K+1 Next I Next J Print K
下列程序段的执行结果为______。 Private Sub Command1_Click() n = 0 For a = 1 To 20 For b = 1 To 20 For c = 1 To 20 If a * a + b * b - c * c Then n=n+l End If Next c Next b Next a Print n End Sub
阅读下面的程序段,执行上面的三重循环后,a的值为 ______ 。 For i=1 To 3 For j=1 To i For k=j To 4 a=a+1 Next k Next j Next i
下列程序段的执行结果为_______。 N=0 For I=1 To 3 For J=5 To 1 Step -1 N=N+1 Next J Next I Print N;J;I
下列程序段的执行结果为______。Dim A(10),B(5) For i=1 To 10 A(i)=i Nex i For j=1 To 5 B(j)=j*20 Next j A(5)=B(2) Print "A(5)=";A(5)
下列程序段的执行结果为______。 For x=5 To 1 Step-1 For Y=1 To 6-x Print Tab(Y+5);"*"; Next Y Print Next x
下列程序段的执行结果为______。 For X=5 To 1 Step-1 For Y=1 To 6-x Print Tab(Y+5);"*" Next Y Print Next X
下列程序段的执行结果为______。 Dim A(3,3) For M=1 To 3 For N=1 To 3 If N=M 0r N=3-M+1 Then A(M,N)=1 Else A(M,N)=0 End If Next N Next M For M=1 To 3 For N=1 To 3 Print A(M, N); Next N Print Next M
有下列程序段: For i=1 To 4 x=4 For J=1 To 3 x=3 For k=1 To 2 x=x+6 Next k Next j Next i ? x 该程序段的执行结果为______。
以上程序段运行的结果是:______. Dim a(-1 To 5) As Boolean Dim flag As Boolean flag = False Dim i As Integer Dim j As Integer Do Until flag = True For i = -1 To 5 j=j+1 if a(i)= False Then a(i)= True Exit For End If If i = 5 Then flag = True End If Next Loop Print j
以下程序段运行的结果是______。 Dim a(-1 To 5)As Boolean Dim flag As Boolean flag=False Dim i As Integer Dim j As Integer Do Until flag=True For i=-1 To 5 j=j+l If a(i)=False Then a(i)=True Exit For End If If i=5 Then flag=True End If Next Loop Print j
以下程序段运行的结果是 ______。 Dim a(-1 To 5)As Boolean Dim flag As Boolean flag=False Dim i As Integer Dim j As Integer Do Until flag=True For i=-1 To 5 j=j+1 If a(i)=False Then a(i)=True Exit For End If If i=5 Then flag=True End If Next Loop Print j
广告位招租WX:84302438

免费的网站请分享给朋友吧