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

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

下列程序打印结果为 ______。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 Sub

A.12345

B.6

C.1 2 3 4 5 6

D.0


参考答案

更多 “ 下列程序打印结果为 ______。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 ” 相关考题
考题 单击窗体时,下列程序的执行结果是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()Dim Check As Boolean, Counter As IntegerCheck = TrueCounter = 5DoDo While Counter 20Counter = Counter + 1If Counter = 10 ThenCheck = FalseExit DoEnd IfLoopLoop Until Check = FalsePrint CounterEnd Sub程序运行后,单击窗体,输出结果为______。

考题 设有如下程序:Private Sub Form_Click()Dim ary(1 To 5)As IntegerDim i As IntegerDim sum As IntegerFor i=1 To 5ary(j)=i+1sum=sum+ary(i)Next 1Print sumEud Sub程序运行后,单击窗体,则在窗体上显示的是A.15B.16C.20D.25

考题 下列程序段的功能为:单击窗体后,在D盘Temp目录下address.txt 文件中输入“张三,20,Male”。请填空。Private Sub form_ click()Dim name As StringDim age As IntegerDim sex As Stringname = "张三": age = 20: sex = "Male"Open "D:\temp\CodE.txt" For Append As 1______1, name, age, sex______End Sub

考题 下列程序的输出结果是【 】Private Sub Command1_Click()Dim a(1 To 20)Dim iFor i=l To 20a(i)=iNext iFor Each i In a()a (i) =20Next i

考题 下列程序输出的结果为【 】。Private Sub Commandl_Click( )Dim a As Booleana = TrueIf a Then GoTo 11 Else GoTo 2211:Print "VB";22:Print "VC"End Sub

考题 设有如下程序:Private Sub Form. Click( )Dim ary(1 To 5)As IntegerDim i As IntegerDim sum As IntegerFor i=1 To 5ary(i)=i+lsum=sum+ary(i)Next iPrint sumEnd Sub程序运行后,单击窗体,则在窗体上显示的是( )。A.15B.16C.20D.25

考题 下面程序的输出结果是【 】。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 Command1_Click() Dim a(20) For j=1 To 20 Step2 a(j)=j Next i Print a(1)+a(2)+a(3) End SubA.4B.5C.6D.7

考题 下列程序的运行机结果是【 】。Private Sub Form_ Click()Dim k As Integern= 5m= 1k= 1Dom=m+2k= k+1Loop While k<=nPrint mEnd Sub

考题 下列程序的执行结果为______。Private sub Command1_ Click ( ) a = 100 b = 50 if a <> b then a = a + b Else b = b -a Print a, bEnd SubA.50 50B.150 50C.200 200D.10 10

考题 有如下事件过程:Private Sub Form. Active ( )Dim Score (1 to 3) As IntegerDim i As IntegerDim t As VariantFori=3 To 1 step-1Score (i) = 2 * iNextFor Each t In ScorePrint tNextEnd Sub程序运行后窗体上显示的值为【 】。

考题 下列程序段的运行结果是:Private Sub Command1_Click() Dim n AS Integer I =21: n = 3 do while I>n I=I- n Loop Print IEnd Sub在窗体上打印的结果是______。A.3B.5C.6D.8

考题 下列程序的运行结果为______。Private Sub Command1_ Click() Dim s As Long Dim x As Integer s = 0 for x = 99 To 1 step - 2 s=s+ x Next x Print sEnd SubA.100B.500C.2500D.5000

考题 有如下过程,将两次调用过程proc的结果分别填于空【 】和【 】处。Private Sub Command1_Click( )Dim a As IntegerDim b As Integera=2b=5Call proc(a,B) 【 】Call proc(A) 【 】End SubPrivate Sub proc(x As Integer,Optional y)Dim z As IntegerIf IsMissing(y) ThenMsgBox ("没有提供可选参数")Elsez=x*yMsgBox ("乘积=" + Str(z))End IfEnd Sub

考题 下列程序的输出结果是【 】。Private Sub Command l Click()Dim a(1 TO 20)Dim iFor i=1 TO 20a(i)=iNext iFor Each i In a()a(i)=20Next iPrint a(2) End Sub

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

考题 有如下函数过程。Function UNC(ByVal x As Integer,ByVal y As Integer)As IntegerDo While y<>0S=x/yx=yy=SLoopUNC=xEnd Function以下事件调用该函数,程序运行结果是【 】。Private Sub Command1_Click()Dim a As IntegerDim b As Integera=12b=2x=UNC(a,b)Print xEnd Sub

考题 单击一次命令按钮之后,窗体中的输出结果为______。 Private Sub Command1_ Click() Dim a As Single Dim b As Single a = 10 b = 20 Call Num(a,B)Print a, b End Sub Sub Num(a,B)t = a a = b / t b = t End SubA.20 10B.10 20C.2 10D.10 10

考题 有过程如下:Sub fact (m As Integer, total As Long) Dim i As Integer total = 1 for i = 1 To m total = total*i Next iEnd Sub调用它的事件过程如下:Private Sub Command1_ Click () Dim tot As Long Dim a As Integer a = Val InputBox (“请输入数据”)) Call fact (a, tot) Print totEnd Sub则输入数据5,运行结果为 ______。A.100B.120C.200D.50

考题 使用窗体的Click事件在窗体输出1~1000之间能同时被5和7整除的整数,如图所示,请填空Private Sub Form_Click()Dim i As IntegerDim Sum As IntegerClsFor i=1 To 1000If 【 】 ThenSum=Sum+iPrintiEnd IfNext iPrintPrint"Sum="SumEnd Sub

考题 单击窗体时,下列程序代码的执行结果为______ 。 Private Sub Test (x As Integer) x=x*2+1 If x < 6 Then Call Test(x) End If x-x*2+1 Print x; End Sub Private Sub Command1_ Click () Test 2 End SubA.23 47B.5 11C.10 22D.23 29

考题 Private Sub Commandl Click()Dim i As Integer, j As IntegerDim a (10,10)As IntegerFor i=1 To 3For j= i To 3a(i,j)=(i-1)*3+jPrint a (i,j);Next jPrintNext iEnd Sub程序运行后,单击命令按钮,窗体上显示的是( )。

考题 假定有如下的Sub过程:Sub Sub1 (x As Single, y As Single) t=x x = t/y y = t Mod yEnd Sub 在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_ Click() Dim a As Single Dim b As Single a = 5 b = 4 Sub1 a, b Print a; b End Sub 程序运行后,单击命令按钮,输出结果为______。A.5 4B.1 1C.1.2 5.4D.1.25 1

考题 下列程序的输出结果是( )。Private Sub Command1_Click()Dim arr(1 To 10)For i=1 To 10Next iFor Each i In arr()Next iEnd Sub

考题 已知两个窗体Form1、Form2,下列事件过程中,______可以实现单击窗体Form1的命令按钮时,显示窗体Form2,而窗体Form1消失。A.Private Sub Command1_ Click() LoadForm2 Form1. Hide End SubB.Private Sub Command1_ Click() Show Form2 Form1. Hide EndSubC.Private Sub Command1_ click() Show Form2 Form1. Hide End SubD.Private Sub Command1_ click()

考题 下列程序的执行结果为 Private Sub Commandl_Click() Dim s1 As String ,s2 As String s1= "abcd" Call Transfer(sl,s2) Print s2 End Sub Private Sub Transfer (ByVal xstr As String,ystr As String) Dim tempstr As String ystr=tempstr End SubA.dcbaB.abdcC.abcdD.dabc