单击命令按钮执行下列程序,其输出结果是()。Private Sub Command1_Click()Dim a As Integer,b As

15 查阅

单击命令按钮执行下列程序,其输出结果是( )。

Private Sub Command1_Click()

Dim a As Integer,b As Integer,c As Integer

a=3

b=4

c=5

Prim SecProc(c,b,A)

End Sub

Function FirProc(x As Integer,y As Integer,z As Integer)

FirProc=2*x+y+3*z

End Function

Function SecProc(x As Integer,y As Integer,z As Integer)

SecProc=FirProc(z,x,y)+x

End Function

A.20

B.22

C.28

D.30

参考答案:

C解析:本题是在Command1过程中调用SecProc函数,而在SecProc函数中又调用了FirPmc函数。函数调用时,实参和形参要一一对应传递。程序运行过程是:①Ptint SecProc(c,b,s)→Print SecProc(5,4,3);②Sec Proc=FinProc(z,x,y)+x→SecProc=FirProc(3,5,4)+5;③FirProc=2*x+y+3*z→FirProz=3*3+5+3*4=23;④SecProc=28→Print SeProc(c,b,A)→Print

计算机二级