在窗体上添加一个名称为Command1的命令按钮,然后编写如下事件代码: Private Sub Command1_Click() A=75 If a<60 Then x=1 If a<70 Then x=2 If a<80 The

admin2013-01-07  26

问题 在窗体上添加一个名称为Command1的命令按钮,然后编写如下事件代码:
    Private Sub Command1_Click()
    A=75
    If a<60 Then x=1
If a<70 Then x=2
If a<80 Then x=3
If a<90 Then x=4
MsgBox x
End Sub
运行窗体,单击命令按钮,则消息框的输出结果是(    )。

选项 A、1
B、2
C、3
D、4

答案D

解析 在本题中,75大于60,所以不执行x=1,再判断75大于70,所以不执行x=2,接着判断75不大于80,所以执行x=3,最后判断75不大于90,所以不执行x=4,最后MsgBox就输出x的值为4。
转载请注明原文地址:https://jikaoti.com/ti/HGw0FFFM
0

最新回复(0)