问题
单项选择题
当Command1_Click事件发生时,窗体上显示的内容是 ______。 Private Sub Command1_Click() Dim a As Integer,b As Integer,c As IntegerIf a = 0 Then x = x-1 Else If b <> 0 Then x = 7 Else x=x+8 End If If c <> 0 Then x = x-3 Else x = 4 End If Print xEnd Sub
A.7
B.8
C.4
D.3
答案
参考答案:C
解析: 本题先定义了三个变量,其默认值都为0。执行If语句,其条件“a=0”为True,“b<>0”为False,“c<>0”为False.依次执行结构体中的语句后,x的值为4。