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

计算机 单击,按钮,命令 已帮助 人

单击命令按钮执行下列程序,其输出结果是。 Private Sub Commana1_Click() Dim a As Integer,b As Integer,c As Integer a = 3 b = 4 c = 5 Print 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 FunctionA. 20 B. 22 C. 28 D. 30

热搜:下面程序的功能是输出数组s中最大元素

答案解析

难度★★☆ 搜索
  • 参考答案:C
    【解析】本题是在Commana1过程中调用SecProc函数,而在SecProc函数中又调用了FirProc函数。函数调用时,实参和形参要一一对应传递。程序运行过程是:①Print SecProc(c,b,a)→Print SecProc(3,5,4);②SecProc = FirProc(z,x,y) + x→SecProc = FirProc(3,5,4) + 5;③FirProc = 2 * x + y + 3 * z→FirProc = 2 * 3 + 5 + 3 * 4=23;④SecProc = 28→Print SecProc(c,b,a)→Print28.形参是在被调用的Sub、Function过程中定义的参数名;实参则是在调用的Sub或Function过程中定义的参数名。