假定有如下的Sub过程: Sub sfun(x As Single,y As SinglE)t=x x=t/y y=t Mod y End Sub 在窗体上添加一个命令按钮(名为Command1),然后编写如下事件过程:

admin2010-06-10  16

问题 假定有如下的Sub过程:    Sub sfun(x As Single,y As SinglE)t=x    x=t/y    y=t Mod y    End Sub    在窗体上添加一个命令按钮(名为Command1),然后编写如下事件过程:    Private Sub Command1_Click( )      Dim a as single      Dim b as single      a=5      b=4      sfun a,b      MsgBox a &char(10

选项 A、1和1     
B、 1.25和1
C、 1.25和4     
D、 5和4

答案B

解析  此题中设定了一个sfun( )函数,进行除法运算和求模运算,为命令按钮(名为Command1)编写书件,定义两变量a=5,b=4:调用此函数传递a,b的值给x,y进行运算,t=x=5,y=4;x=t/y=5/4=1.25(除法运算):y=t Mod y=5 mod 4=1(求模运算)。
转载请注明原文地址:https://kaotiyun.com/show/Szup777K
0

最新回复(0)