9.程序执行结果s的值是 [9] 。
Private Sub Commandl_Click()
i = 0
Do
i = i + l
s = i + s
Loop Until i > = 4
Print s
End Sub
第1题:
下列程序的执行结果是 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
第2题:
【题目描述】
第 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
【参考答案分析】:
97
第3题:
下面程序的输出结果是【 】。
Private Sub Commandl_Click( )
Dim a(1 To 20)
Dim i
Fori = 1 To 20
a(i) = i
Next i
For Each i In a( )
a(i) = 20
Next i
Print a(2)
End Sub
第4题:
以下能够正确计算n!的程序是
A.Private Sub Command1_Chck( ) n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End Sub
B.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<n Print x End Sub
C.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<=n Print x End Sub
D.Private Sub Command1_Click( ) n=5:x=1:i=l Dox=x*i i=i+1 Loop While i>n Print x End Sub
第5题:
以下能够正确计算n! 的程序是( )。
A.Private Sub Command1_Click( ) n=5:x=l Do x=x*i i=i+1 Loop While i < n Print x End Sub
B.Private Sub Command1_Click( ) n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i < n Print x End Sub
C.Private Sub Command1_Cliek( ) n:5:x=1:i=1 Do x=x* i i:i+1 Loop While i < = n Print x End Sub
D.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
第6题:
下面程序的输出结果是【 】。
Private Sub Form_Click()
i=0
Do Until 0
i=i+1
if i>10 then Exit Do
Loop
Print i
End Sub
第7题:
下列程序的输出结果是______。
Private Sub Commandl_Click()
Dim alt(1 To 10)
Fori=1 To 10
arr(i) =I
Next i
For Each i In arr()
arr(i) =arr(i) *2+1
Next i
MsgBox arr(7)
End Sub
第8题:
下面程序运行后,输出结果是( )。 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 Prin
A.5101520
B.2468
C.出错
D.0000
第9题:
单击窗体时,下列程序的执行结果是 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 Sub
A.abcdef
B.afbecd
C.fedcba
D.defabc
第10题:
以下能够正确计算1+2+3+…+10的程序是
A.Private sub Command1_Click( ) sum=0 For 1=1 To 10 Sum=sum+1, Next I Print Sum End Sub
B.Private sub Command1_Click( ) Sum=0,I=1 Do While l<=10 Sum=Sum+1 I=I+1 Print Sum End Sub
C.Private Sub command1_click( ) Sum=0:I=1 Do Sum=Sum+1 I=I+1 Loop While I<10 Print Sum End Sub
D.Private Sub command1_Click( ) Sum=0:I=1 Do Sum=Sum+1 l=I+1 Loop Until I<10 Print Sum End Sub
第11题:
有如下程序: 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.1
B.2
C.3
D.5
第12题:
以下能够正确计算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 Sub
C.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
第13题:
在窗体上有一个命令按钮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
第14题:
在窗体上画一个命令按钮,然后编写如下事件过程: 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.135
B.357
C.531
D.753
第15题:
下面程序的输出结果是【 】。
Private Sub Form_Click()
i=0
Do Until 0
i=i+1
if i>10 then Exit Do
Loop
Print i
End Sub
第16题:
执行下面的程序段,x的值为 Private Sub Commandl_Click() For i=1 To 5 a=a+i Next i x=Val(i) MsgBox x End Sub
A.5
B.6
C.7
D.8
第17题:
单击一次命令结束后,下列程序的执行结果是 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 Function
A.15
B.25
C.35
D.45
第18题:
以下能够正确计算1+2+3+…+10的程序是
A.Private Sub Command1_Click() Sum=0 ForI=1 To 10 Sum=Sum+I Next I Print Sum End Sub
B.Private Sub Command1_Click() Sum=0,I=1 Do While I<=10 Sum=Sum+I I=I+1 Print Sum End Sub
C.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop While I<10 Print Sum End Sub
D.Private Sub Command1_Click() Sum=0: I=1 Do Sum=Sum+I I=I+1 Loop Until I<10 Print Sum End Sub
第19题:
下列程序运行后的输出结果是______。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 Sub
A.0
B.3
C.6
D.9
第20题:
下面的程序运行结果是( )。 Private Sub Form_Click() I=0 DoUntil0 i=i+1 if i>10 then Exit Do Loop Printi End Sub
A.0
B.10
C.11
D.出错
第21题:
下列程序的执行结果为 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 Sub
A.fedcba
B.abcdef
C.afbecd
D.defabc
第22题:
下列程序的执行结果为 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 FunCtion
A.abcdef
B.afbecd
C.fedcba
D.defabc
第23题:
下列程序的执行结果为 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 Sub
A.fedcba
B.abcdef
C.afbecd
D.defabc