网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

9.程序执行结果s的值是 [9] 。

Private Sub Commandl_Click()

i = 0

Do

i = i + l

s = i + s

Loop Until i > = 4

Print s

End Sub


参考答案

更多 “ 9.程序执行结果s的值是 [9] 。Private Sub Commandl_Click()i = 0Doi = i + ls = i + sLoop Until i = 4Print sEnd Sub ” 相关考题
考题 执行下面的程序段,x的值为【 】。Private Sub Command1_Click()For i=1 To 9a=a+iNextx=Val(i)MsgBox xEnd Sub

考题 单击窗体时,下列程序的执行结果是Private Sub Invert(ByVal xstr As String, ystr As String)Dim tempstr As StringDim I As IntegerI=Len(xstr)Do While I =1tempstr=tempstr + Mid(xstr, I, 1)I=I - 1Loopystr=tempstrEnd SubPrivate Sub Form_Click()Dim s1 As String, s2 As Strings1= "abcdef"Invert s1, s2Print s2End Sub( )。A.abcdefB.afbecdC.fedcbaD.defabc

考题 下面程序执行时,输出的结果是( )。 Private Sub Form_Click() DimiASInteger,j As Integer i=10 Do i=i+j forj=10 toistep-3 i=i+j nextj Loop Whilei<50 Printi;j End SubA.50 10B.50 9C.57 10D.59 9

考题 程序执行结果s的值是【 】.Private Sub Command l-Click ()I =0DoS= I +SI = I + lLoop Until I >=4End Sub

考题 下列程序的执行结果是 Function P(N As Integer) For i=1 To N Sum=Sum+i Next i P=Sum End Function Private Sub Commandl_Click() S=P(1)+P(2)+P(3)+P(4) Print S End SubA.15 B.16 C.20 D.25

考题 在窗体上有一个命令按钮Commandl,通用过程fun和命令按钮的事件过程如下: Private Function fun(By m As Integer) If m Mod 2=0 Then fun=2 Else Fun=1 Else If End Funcion Private Sub Commandl_Click() Dim i Integer,s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,则窗体上输出A.6 B.7 C.8 D.9

考题 请教:2011年全国计算机等级考试二级VB全真模拟试卷(3)第2大题第5小题如何解答? 【题目描述】 第 40 题 9.程序执行结果s的值是[9]。 Private Sub Commandl_Click() i = 0 Do i = i + l s = i + s Loop Until i = 4 Print s End Sub

考题 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Commandl_Click() Dim a() a=Array(1,3,5,7) s=0 For i=1 To 3 S=S*10+a(i) Next i Print s End Sub 程序运行后,输出结果为( )。A.135B.357C.531D.753

考题 下面程序的输出结果是【 】。Private Sub Commandl_Click( )Dim a(1 To 20)Dim iFori = 1 To 20a(i) = iNext iFor Each i In a( )a(i) = 20Next iPrint a(2)End Sub

考题 下面程序的输出结果是【 】。Private Sub Form_Click()i=0Do Until 0i=i+1if i>10 then Exit DoLoopPrint iEnd Sub

考题 以下能够正确计算n!的程序是A.Private Sub Command1_Chck( ) n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<=n Print x End SubD.Private Sub Command1_Click( ) n=5:x=1:i=l Dox=x*i i=i+1 Loop While i>n Print x End Sub

考题 执行下面的程序段,x的值为 Private Sub Commandl_Click() For i=1 To 5 a=a+i Next i x=Val(i) MsgBox x End SubA.5B.6C.7D.8

考题 以下能够正确计算n! 的程序是( )。A.Private Sub Command1_Click( ) n=5:x=l Do x=x*i i=i+1 Loop While i < n Print x End SubB.Private Sub Command1_Click( ) n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i < n Print x End SubC.Private Sub Command1_Cliek( ) n:5:x=1:i=1 Do x=x* i i:i+1 Loop While i < = n Print x End SubD.Private Sub Command1_Cliek( ) n=5:x:1:i=1 Do x=x*i i=j+1 Loop While i > n Print x End Sub

考题 单击一次命令结束后,下列程序的执行结果是 Private Sub Commandl_Click( ) s=Sat(1)+Sat(2)+Sat(3)+Sat(4) Print s End Sub Public Function Sat(N As Integer) Static Sum For i=1 To N Sum=Sum+i Next i Sat=Sum End FunctionA.15B.25C.35D.45

考题 下面程序的输出结果是【 】。Private Sub Form_Click()i=0Do Until 0i=i+1if i10 then Exit DoLoopPrint iEnd Sub

考题 以下能够正确计算1+2+3+…+10的程序是A.Private Sub Command1_Click() Sum=0 ForI=1 To 10 Sum=Sum+I Next I Print Sum End SubB.Private Sub Command1_Click() Sum=0,I=1 Do While I<=10 Sum=Sum+I I=I+1 Print Sum End SubC.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop While I<10 Print Sum End SubD.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop Until I<10 Print Sum End Sub

考题 下列程序的输出结果是______。Private Sub Commandl_Click()Dim alt(1 To 10)Fori=1 To 10arr(i) =INext iFor Each i In arr()arr(i) =arr(i) *2+1Next iMsgBox arr(7)End Sub

考题 下列程序运行后的输出结果是______。Private Sub f(k,s) s = 1 for j = 1 To k s=s*j Next jEnd SubPrivate Sub Command1_ Click () Sum = 0 for i = 1 To 3 Call f(i, s) Sum = Sum + s Next i Print Sum End SubA.0B.3C.6D.9

考题 下面程序运行后,输出结果是( )。 Private Sub mysub(b()As Integer,OptionalByValnAsInteger=2) ForI=1 to 4 b(I)=n*I NextI End Sub Private Sub Commandl_Click() Dima(1 to 4)As Integer,I As Integer Callmysub(a(),5) Mysuba() ForI=1 to 4 PrinA.5101520B.2468C.出错D.0000

考题 下面的程序运行结果是( )。 Private Sub Form_Click() I=0 DoUntil0 i=i+1 if i>10 then Exit Do Loop Printi End SubA.0B.10C.11D.出错

考题 单击窗体时,下列程序的执行结果是 Private Sub Invert(By Val xstr As String,ystr As String) Dim tempstr AS String Dim I AS Integer I=Len(xstr) Do While I>=1 tempstr=tempstr + Mid(xstr,I,1) I=I - 1 Loop ystr=tempStr End Sub Private Sub Form_Click( ) Dim s1 As String,s2 As String S1="abcdef" Invert S1,S2 Print S2 End SubA.abcdefB.afbecdC.fedcbaD.defabc

考题 下列程序的执行结果为 Private Sub Command1_C1ick( ) Dim sl As String,s2 AS String s1="abcdef" Call lnvert(s1,s2) Print s2 End Sub Private Sub lnvert(ByVal xstr As String,ystr As String) Dim tempstr As Stdng i=Len(xstr) Do While i>=1 tempstr=tempstr+Mid(xstr,i,1) i=i-1 Loop ystr=tempstr End SubA.fedcbaB.abcdefC.afbecdD.defabc

考题 以下能够正确计算1+2+3+…+10的程序是A.Private sub Command1_Click( ) sum=0 For 1=1 To 10 Sum=sum+1, Next I Print Sum End SubB.Private sub Command1_Click( ) Sum=0,I=1 Do While l<=10 Sum=Sum+1 I=I+1 Print Sum End SubC.Private Sub command1_click( ) Sum=0:I=1 Do Sum=Sum+1 I=I+1 Loop While I<10 Print Sum End SubD.Private Sub command1_Click( ) Sum=0:I=1 Do Sum=Sum+1 l=I+1 Loop Until I<10 Print Sum End Sub

考题 下列程序的执行结果为 Ptivate Sub Commandl_Click() Dim FirStr As String FirStr="abcdef" Print Pct (FirStr) End Sub Private Function Pct(xStr As String)As String Dim tempStr As String,strLen As Integer tempStr="" strLen=Len(xStr) i=1 Do While i<=Len(xStr)-3 tempStr=tempStr + Mid(xStr,i,l) + Mid(xStr,strLen - i+i ,1) i=i + 1 Loop Pct=tempStr End FunCtionA.abcdefB.afbecdC.fedcbaD.defabc

考题 有如下程序: Private Sub Commandl_Click( ) a$="A WORKER IS HERE" x=Len(a$) For i=1,To x-1 b$=Mid$(a$,i,3) If b$="WOR" Then S=S+1 Next Print S End Sub 单击命令按钮,程序运行结果为A.1B.2C.3D.5

考题 下列程序的执行结果为 Private Sub Command1_Click() Dim s1 As String,s2 As String S1;="abcdef" Call Invert(s1,s2) Print s2 End Sub Private Sub Invert (ByVal xstr As String,ystr As String) Dim tempstr As String i=Len(xstr) Do While i=1 tempstr=tempstr+Mid(xstr,i,1) i=i-1 Loop ystr=tempstr End SubA.fedcbaB.abcdefC.afbecdD.defabc

考题 以下能够正确计算n!的程序是( )。A.Private Sub Commandl_C1ick()B.hiVate Sub Commandl_C1ick() n=5:x=1 n=5:x=1:i=1 DO DO X=x*1 X=X*1 i=i+1 i=i+1 Loop while i<n Loop While<n Print x Ptinte x End Sub End SubC.Private Sub Commandl_Click ()D.Pdvate Sub Commandl C1ick() n=5:X=1:i=1 n=5=:x=1:i=1 DO DO X=X*1 X=X*1 i=i+1 i=i+1 Loop While i>n Print x Print x End Sub End Sub