编写如下程序: Private Sub Command1_Click() Dim a As Integer, b As Integer a = 3 b = 2 If a * b < 10 Then b = b + 1 Else b

admin2018-05-08  31

问题 编写如下程序:
Private Sub Command1_Click()
   Dim a As Integer, b As Integer
   a = 3
   b = 2
   If a * b < 10 Then b = b + 1 Else b = b - 1
   Print b - a > 0
End Sub
程序运行后,单击命令按钮Command1,输出结果为

选项 A、True
B、False
C、1
D、-1

答案B

解析 If…Else语句对b进行操作。a * b =6 ,< 10,所以执行b = b + 1=3。Print语句中,b-a=0,条件为假。选B。
转载请注明原文地址:https://kaotiyun.com/show/cSGp777K
0

最新回复(0)