在窗体上画一个命令按钮,然后编写如下程序: Dim x As Integer Sub inc(a As Integer) x=x+a End Sub Private Sub Command1_CliCk() inc2 inc3 inc4 Msgbox x;

admin2010-01-05  31

问题 在窗体上画一个命令按钮,然后编写如下程序:
Dim x As Integer
Sub inc(a As Integer)
x=x+a
End Sub
Private Sub Command1_CliCk()
inc2
inc3
inc4
Msgbox x;
End Sub
程序执行后,单击Command1命令按钮,消息框显示结果是【  】

选项

答案9

解析 inc函数每执行一次就向x上累加一次传入的参数,所以最后x的值为 2+3+4=9。
转载请注明原文地址:https://jikaoti.com/ti/SfP0FFFM
0

最新回复(0)