更多"下列程序的输出结果是 【15】 。 Private Sub Comma"的相关试题:
[单项选择]以下程序运行后,单击按钮输出结果是
Private Sub Commandl_Click( )
Dim x As Integer,y As Integer,z As Integer
X=4:y=2: Z=3
Call Gopd(x,x,z)
Print x;X;Z
Call Gopd(x,y,y)
Print x;y;y
End Sub
Private Sub Gopd(x As Integer,y As Integer,z As Integer)
X=3 * Z + 1
y=2 * z
z=x + y
End Sub
A. 6 6 12
B. 8 5 10
C. 9 6 12
D. 8 10 10
[填空题]下面程序的输出结果是 【15】 。
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
[填空题]下列程序的输出结果是______。
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
[填空题]下列程序输出的结果为 【12】 。
Private Sub Commandl_Click( )
Dim a As Boolean
a = True
If a Then GoTo 11 Else GoTo 22
11:
Print "VB";
22:
Print "VC"
End Sub
[填空题]下列程序的输出结果是 【15】 。
Private Sub Commandl Click( )
Dim a(1 To 20)
Dim i
For i=1 To 20
a(i)=i
Next i
For Each i ln a( )
a(i)=20
Next i
Print a(2)
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 Function
A. 15
B. 25
C. 35
D. 45
[单项选择]单击命令按钮时,下列程序的执行结果是
Private Sub Commandl_Click( )
Dim a As Integer,b As Integer,c As Integer
a=3:b=4:c=5
Print SecProc(c,b,a)
End Sub
Function FirProc(x As Integer,y As Integer,z As Integer)
FirProc=2*x+y+3*z
End Function
Function SecProc(x As Integer,y As Integer,z As Integer)
SecProc=FirProc(z,x,y) +x
End Function
A. 20
B. 22
C. 28
D. 30
[单项选择]下面程序的运行结果是( )。
Private Sub Commandl_Click( )
a=1.5
b=1.5
Callfun(a,b)
Printa,b
End Sub
Private Subfun(x,y)
x=y*y
y=y+x
End Sub
A. 2.25 1.5
B. 1.5 2.25
C. 2.25 3.75
D. 0.75 1.5
[单项选择]下面程序段,运行后的结果是( )。
Private Sub Commandl_Click( )
Dim b%(1 To 4),i%,t#
For i=1 To 4
b(i)=i
Next i
t=Tof(b( ) )
Print"t=";t,
End Sub
Function Tof(a( ) As Integer)
Dim t#,i%
t=1
For i=2 To UBound(a)
t=t * a(i)
Next i
Tof=t
End Function
A. t=18
B. t=24
C. t=30
D. t=32
[填空题]下列程序输出的结果为______。
Private Sub Commandl_Click( )
Dim a As Boolean
a = True
If a Then GoTo 11 Else GoTo 22
11:
Print "VB";
22:
Print "VC"
End Sub
[单项选择]有如下程序:
Private Sub Commandl_Click( )
Dim i As Integer
For i=1 To 2
DS
Next i
End Sub
Sub DS( )
Dim x As Integer,m As String
Static y,n
X=X + 1
y=y + 1
m=m &"*”:n=n&"#"
Print x,y,m,n
End Sub
程序运行后,输出的结果是( )。
[单项选择]有如下程序:
Private Sub Commandl_Click( )
Dim a As Integer
a=2
For i=1 To 3
Print Gad (a)
Next i
End Sub
Function Gad (a As Integer)
b=0
Static c
b=b + 1
c= c + 1
Gad= a + b + C
End Function
运行上面的程序后,单击命令按钮,输出结果为( )。
[单项选择]有如下程序:
Private Sub Commandl_Click( )
Dim i As Integer
For i=1 To 2
DS
Next i
End Sub
Sub DS( )
Dim x As Integer,m As String
Static y,n
X=X + 1
y=y + 1
m=m &"*”:n=n&"#"
Print x,y,m,n
End Sub
程序运行后,输出的结果是
A. 1 1 * #
B. 1 1 * #
C. 1 1 * #
D. 1 1 * #
[单项选择]有如下程序: Private Sub Commandl_Click( ) Dim a As Single Dim b As Single a=2:b=4 Call CS(a,b) End Sub Sub CS(x As Single,y As Single) t=X x=t/y y=t Mod y End Sub 程序运行后,单击命令按钮,a和b的值分别为
A. 0 0
B. 1 1
C. 0 2
D. 1 2
[单项选择]下列程序的执行结果为 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 Sub
A. dcba
B. abdc
C. abcd
D. dabc