[单项选择题] 有如下函数:
Function fun(a As Integer,n As Integer) As Integer
Dim m As Integer
While a>=n
a=a-n
m=m+1
Wend
fun=m
End Function
该函数的返回值是( )
A.a乘以n的乘积
B.a加n的和
C.a减n的差
D.a除以n的商(不含小数部分)
参考答案:
D问题解析:
m的整型默认值为0,m中记录的是a减n的次数,即相当于a除以n所得的商值。当a小于n时就结束循环,即余数小于除数时就结束循环。

![[单项选择题] 有如下函数: Function fun(a As Integer,n As Integer) As Integer Dim m As Integer While a>=na= [单项选择题] 有如下函数: Function fun(a As Integer,n As Integer) As Integer Dim m As Integer While a>=na=](http://www.mshxw.com/aiimages/31/258633.png)
