有如下函数过程: Function HFC(ByVal x AS Integer,ByVal y As Integer)As Integer Do While y < > 0 sic=x/y X=y y=sic Loop HFC=x End Function 以下是该函数的调用过程,该程序的运行结果是()。 Private Sub Command1 _ Click( ) Dim a AS Integer Dim b As Integer a=12 b=2 x=HFC(a,b) Print x End Sub
A.0
B.6
C.2
D.80
参考答案:B
解析:本题考查函数调用和输出格式的语句。调用HFC的过程如下: x=12,y=2时,sic=6,x=2,y=6 x=2,y=6时,sic=0,x=6,y=0 y=0,跳出循环,输出x=6并结束程序。