[填空题] 在窗体上面画一个命令按钮,然后编写如下程序: Function M(x As Integer, y As Integer) As Integer M = IIf(x>y, x, y) End Function Private Sub Command1_Click() Dim a As Integer, b As Integer a = 2 b = 5 Print M(a, b) End Sub 程序运行后,单击命令按钮,输出结果为 【5】 。
正确答案:E
参考解析:IIf函数的作用是根据表达式的值来返回两部分中的其中一个。因为2>5为False,所以返回的是传入的第二个参数b,输出为5。


![[填空题] 在窗体上面画一个命令按钮,然后编写如下程序: Function M(x As Integer, y As Integer) As Integer M = IIf(x>y, x, y) [填空题] 在窗体上面画一个命令按钮,然后编写如下程序: Function M(x As Integer, y As Integer) As Integer M = IIf(x>y, x, y)](http://www.mshxw.com/aiimages/31/480912.png)
