首页/ 题库 / [单选题]运行以下程序后,输出的结果是 for i的答案

运行以下程序后,输出的结果是 for i=1 to 3 cls print" i=",i; Next

单选题
2022-01-04 12:16
A、123
B、3
C、i=1i=2i=3
D、i=3
查看答案

正确答案
D

试题解析
解析:cls语句的功能是清除窗体或其他对象上的所有输出,因此,本题中开始输出的i=1和i=2都被清除,只剩下i=3。答案为选项D。

标签:
感兴趣题目
假定有以下程序段 n=0 for i=1 to 3 for j=-4 to -1 n=n+1 next j next i 运行完毕后,n的值是(. )
阅读下面的程序段: For a=1 To 2 For b=1 To a For c=b To 2 i=i+1 Next Next Next Print i 执行上面的3重循环后,i的值为
以下程序的输出结果为 Dim i,c(10),p(3) k=5 For i=0 To 10 c(i) =i Next i For i=0 To 2 p(i) = c(i * (i + 1)) Next i For i=0 To 2 k=k+p(i) * 2 Next i Print k
下列程序运行时输出的结果是( )。 Option Base 1 Const a=10 Private Sub Form_Click() Dim x(a)As Integer k=-1 For i=1 To a x(i)=i*k k=(-1)*k Next i For i=1 To 10 Print x(i) Next i End Sub
以下程序的输出结果是( )。 Option Base 1 Private Sub Command1_Click() Dim a(10),p(3) as Integer k=5 For I-1 to 10 a(i)=I Next I For j=1 to3 p(i)=a(I*j) Next j For I=l to 3 k=k+ p (I)*2 Next I Print k End Sub
在窗体上画一个名称为Commandl的命令按钮,然后编写如下程序: Private Sub Command1_Click() Dim i As Integer,j As Integer Dim a(10, 10)As Integer For i=1 To 3 For i=1 To 3 a(i,j)=(i-1) *3+j Print a(i,j); Next i Print Next i End Sub 程序运行后,单击命令按钮,窗体上显示的是
下面程序段的运行结果是( )。 Private Sub Form_Click() For I=3 to 1 step-1 Print Spc(10-I); For j=1 to 2*I-1 print"*"; Next j Print Next I End Sub
若有以下程序,当程序运行后,单击命令按钮,则输出的结果为( )。 Private Sub Command1_Click() Dim a%(1 To 4), b%(3 To 6), i%, s1#, s2# For i= 1 To 4 a(i) = i Next i For i=3 To 6 b(i) = i Next i s1 = Factorial (A) s2 = Factorial (B) Print "s1="; s1; "s2="; s2 End Sub Function Factorial(a() As Integer) Dim t#, i% t=1 For i = LBound(A)To UBound(A) t = t * a(i) Next i Factorial = t End Function
下面程序运行后,输出结果为( )。 Dim a() a=Array(1,3,5,7,9) s=0 For i=1 To 4 s=s*10+a(i) Next i Print s
有以下程序: Option Base 1 Dim arr()As Integer Private Sub Form. Click() Dim i As Integer,j As Integer ReDim arr(3,2) For i=1 To 3 For j=1 To 2 arr(i,j)=i*2+j Next j Next i ReDim Preserve arr(3,4) For j=3 To 4 arr(3,j)=j+9 Next j Print arr(3,2);arr(3,4) End Sub 程序运行后,单击窗体,输出结果为______。
下列程序段的执行结果为 n=0 For i=1 To 3 For j=5 To 1 Step-1 n=n+1 Next j,i Print n;j;i
阅读下面程序段: For a=1 To2 For b =1 To a For c = b To 2 i=i+1 Next Next Next Print i 执行上面的3重循环后,i的值为
相关题目
下面程序运行后输出结果是( )。 For I=1 to 2 S=1 For j=0 to I-1 S=S+S*I Next j Print S Next I
运行下面的程序后,输出的结果为 Cls Dim t(5,5) as Integer For i=1 To 5:t(i,i)=1:Next For i=1 To 5 For j=1 To 5 Print t(i,j), Next j Print Next I
有以下程序: main() { int a[3][3],*P,i; p=&a[0][0]; for(i=0;i<9;i++)p[i]=i; for(i=0;i<3;i++)printf("%d",a[1][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
以下程序的输出结果是 ______。 Dim n(2,2), i, j As Integer For i = 0 To 2 For j = 0 To 2 n(i,j) = i + j Next j Next i For i = 0 To 1 For j = 0 To 1 n(i+ 1 ,j + 1) = n(i + 1,j + 1) + n(i, j) Next j Next i Print n(i, j)
以下程序的输出结果是D)9 12 Option Base 1 Private Sub Command1_Click() Dim s(10),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 1 PRIVATE SUB COMMAND1_CLICK( ) DIM A(10) , 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 MSGBOX K END SUB
下列程序运行时输出的结果是 Option Base 1 Private Sub Form_Click() Dim x(10) As Integer,y(5) As Integer For i=1 to 10 x(i)=10-i+1 Next For i=1 to 5 y(i)=x(2*i-1)+x(2*i) Next For i=1 to 5 Print y(i) Next End Sub
下列程序运行时输出的结果是 Option Base 1 Private Sub Form_Click() Dim x (10)As Integer,y(5)As Integer For i=1 to 10 x(i)=10-i+1 Next For i=1 to 5 y(i)=x(2*i-1)+x(2*i) Next For i=1 to 5 Print y(i) Next 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
假定有以下程序段For i=1 To 3 For j=5 To 1 Srep-1 Print i*j Next jNext i则语句Print i*j 的执行次数是______。
以下程序的输出结果是( )。 Option Base 1 Private Sub Command1 Click() Dim a(10),p(3)as Integer k=5 For I=1 to 10 a(i)=I Next I For j=1 to 3 p(i)=a(I*j) Next j For I=1 to 3 k=k+p(I)*2 Next I Print k End Sub
运行以下程序后,输出的结果是 for i=1 to 3 cls print" i=",i; Next
运行以下程序,输出结果是( )。 For I=1 To 3 cls Print"I=",I; Next
运行下面的程序后,输出的结果为 Cls Dim t(5,5)as Integer For i=1 To 5:t(i,i)=1:Next For i=1 To 5 For j=1 To 5 Print t(i,j), Next Print Next
运行下面的程序后,输出的结果为 Cls Dim t(5, 5) as Integer For i=1 To 5: t(i,i) =1: Next For i = 1 To 5 For j = 1 To 5 Print t(i, j), Next Print Next
假定有以下程序段 n=0 for i=1 to 3 for j=-4 to -1 n=n+1 ‘ next j next i 运行完毕后,n的值是( )
假定有以下程序段 n=0 for i=1 to 3 for j=-4 to -1 n=n+1 next j next i 运行完毕后,n的值是( )。
假定有以下程序段 n=0 for i=1 to 3 for j=-3 to 1 n=n+1 next j next i 运行完毕后,n的值是( )。
广告位招租WX:84302438

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