更多"有如下一个Sub过程: Sub mlt(ParamArray num"的相关试题:
[单项选择]有如下一个Sub过程:
Sub mlt (ParamArray numbers( ))
n=1
For Each x In numbers
n=n * x
Next x
Print n
End Sub
在一个事件过程中如下调用该Sub过程:
Private Sub Coinmand1_Click( )
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
a=1
b=2
c=3
d=4
mlt a,b,c,d
End Sub
则运行该程序,结果为______。
A. 12
B. 24
C. 36
D. 48
[单项选择]Sub过程与Ftmetion过程最根本的区别是( )。
A. Sub过程的过程名不能返回值,而Function过程能通过过程名返回值
B. Sub过程可以使用Call语句或直接使用过程名调用,而Function过程不可以
C. 两种过程参数的传递芎式不同
D. Fuactioa过程可以有参数,Sub过程不可以
[单项选择]Sub过程与Function过程最根本的区别是( )。
A. Sub过程不能返回值,而Function过程能返回值
B. Function过程可以有形参,Sub过程不可以
C. Sub过程可以使用Call语句直接使用过程名调用,而Function过程不可以
D. 两种过程参数的传递方式不同
[单项选择]假定有如下的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 4
B. 1 1
C. 1.2 5.4
D. 1.25 1
[单项选择]现有如下Sub过程:
Sub fun(x es single,y as single)
t = x
x = t/y
y = t mod y
End sub
在窗体上添加命令按钮(cmD) ,编写如下事件过程:
Private sub cmd_click( )
Dim a as single
Dim b as single
a = 5
b = 4
fun a, b
Msgbox a & chr(10) + chr(13) & b
End sub
运行程序后,单击按钮,则在消息框中显示的内容为( )
A. 1和1
B. 1.25和1
C. 1.25和4
D. 5和4
[单项选择]有下列Sub过程:
Sub Sun(x As Single,y As Single)
t=x
x=t/y
y=t Mody
End Sub
在窗体上的命令按钮Command1中,编写下列事件过程,执行该事件过程调用Sun过程,结果是( )。
Private Sub Conunandl Cliek( )
Dim a As Single
Dim b As Single
a=5
b=4
Sun a,b
Print a;b
End Sub
A. 1.25 1
B. 5 4
C. 4 5
D. 1 1.25
[填空题]有如下Sub过程:
Sub ind(a As Integer)
Static x As Integer
x= x + a
Print x:
End Sub
以下是调用它的事件过程,程序运行后,单击命令按纽Command1三次,输出结果为 【14】 。
Private Sub Command1_Click( )
Ind 2
End Sub
[单项选择]假定有如下的Sub过程:
sub sfun(x As Single,y As Single)
t=x x=t/y
y=t Mod y
End Sub
在窗体上添加一个命令按钮(名为Command1),然后编写如下事件过程:
Private Sub Command1_Click ( ) Dim a as single
Dim b as single a=5
b=4
sfun a,b
MsgBox a & chr(10)+chr(13) & b
End Sub 打开窗体运行后,单击命令按钮,消息框的两行输出内容分别为______。
A. 1 和 1
B. 1.25 和 1
C. 1.25 和 4
D. 5 和 4
[单项选择]假定有如下的Sub过程:
Sub sfml(x As Single,y As Single)
t=x
x=t/y
y=t Mod y
End Sub
在窗体上添加一个命令按钮(名为Command1),然后编写如下事件过程:
Private Sub Commandd1_Click( )
Dim a as single,b as single
a=5:h=4
sflln a,b
MsgBox a & chr10.+chr13.& b
End Sub
打开窗体运行后,单击命令按钮,消息框的两行输出内容分别为
A. 1和1
B. 1.25和1
C. 1.25和4
D. 5和4
[单项选择]假定有如下的Sub过程:
Sub sfun(x As Single,y As Single)
t=x
x=t/y
y=t Mod y
End Sub
在窗体上添加一个命令按钮(名为Command1),然后编写如下事件过程:
Private Sub Command1_Click( )
Dim a As single
Dim b As single
a=5
b=4
sfun a,b
MsgBox a & chr(10)+chr(13)&b
End Sub
打开窗体运行后,单击命令按钮,消息框的两行输出内容分别为( )。
A. 1和1
B. 1.5和1
C. 1.25和4
D. 5和4
[填空题]有如下SUB过程:
Sub s(x As Single,y As Single)
t =x
x=t / y
Y=t Mod y
End Sub
在窗体上添加一个命令按纽,然后编写如下事件过程:
Private Sub Form_ Click( )
Dim a As Single
Dim b As Single
a=5
b=4
s a,b
Print a,b
End Sub
则程序运行后,单击命令按纽,输出的结果为: 【13】 。