[单项选择题] 有过程如下:Sub fact (m As Integer, total As Long)Dim i As Integertotal = 1for i = 1 To mtot

[单项选择题] 有过程如下:Sub fact (m As Integer, total As Long)Dim i As Integertotal = 1for i = 1 To mtot,第1张

[单项选择题] 有过程如下:Sub fact (m As Integer, total As Long) Dim i As Integer total = 1 for i = 1 To mtot

[单项选择题] 有过程如下:Sub fact (m As Integer, total As Long) Dim i As Integer total = 1 for i = 1 To mtotal = 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.100

B.120

C.200

D.50

正确答案:

B

参考解析:

本题难点是实、虚参数传递的问题。tot按ByRef参数传递。子过程的功能是计算 n!,“5!=120”。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5470303.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-12
下一篇 2022-12-12

发表评论

登录后才能评论

评论列表(0条)

保存