[单项选择题] 程序如下:Private Sub form_ Activate() Dim a As Integer for i=4 To 5a=fun(i)Print a, Next iEnd SubPrivate Function fun(n)As Integer if n >0 thenfun =n* fun(n-1) Elsefun=1 End ifEnd Function 程序最后打印结果是______。
A.4 5
B.12 120
C.24 120
D.24 60
参考答案:
C问题解析:
函数的调用,通过函数的返回值。子过程是个递归过程,其功能是计算阶乘,即 4!=24,5!=120。

![[单项选择题] 程序如下:Private Sub form_ Activate() Dim a As Integer for i=4 To 5a=fun(i)Print a, Next iEnd [单项选择题] 程序如下:Private Sub form_ Activate() Dim a As Integer for i=4 To 5a=fun(i)Print a, Next iEnd](http://www.mshxw.com/aiimages/31/255168.png)
