单击命令按钮时,下列程序的执行结果为  Private Sub Command1_Click()   Dim a As Integer,b As Integer,c As Integer   a=2:b=3:C=4   Print P2(c,b,A)End

admin2009-01-15  38

问题 单击命令按钮时,下列程序的执行结果为  Private Sub Command1_Click()   Dim a As Integer,b As Integer,c As Integer   a=2:b=3:C=4   Print P2(c,b,A)End Sub  Private Function P1(x As Integer,y As Integer,z As Integer)   P1=2 * X + y + 3 * z  End Function  Private Function P2(x As Integer,y As Integer,z As Integer)   P2=P1(z,x,y) + X  End Function

选项 A、21
B、19
C、17
D、34

答案1

解析 对于多个过程或函数依次调用和处理与简单过程调用处理一样,本题先调用函数P2,而函数P2又调用函数P1,结果返回的顺序是从P1到P2,P2计算后输出到调用的地方。
转载请注明原文地址:https://jikaoti.com/ti/a180FFFM
0

最新回复(0)