vb题目求解释
在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:FunctionFunc(ByValxAsInteger,yAsInteger)y=x*yIfy>0T...
在窗体上画一个命令按钮,其名称为
Command1
,然后编写如下程序:
Function Func(ByVal x As Integer, y As Integer)
y = x * y
If y > 0 Then
Func = x
Else
Func = y
End If
End Function
Private Sub Command1_Click()
Dim a As Integer, b As Integer
a = 3
b = 4
c = Func(a, b)
Print "a="; a
Print "b="; b
Print "c="; c
End Sub
程序运行后,单击命令按钮,其输出结果为:
______
A:a= 3 b= 4 c= 12
B:a= 13 b= 12 c= 12
C:a= 3 b= 4 c= 3
D:a= 3 b= 12 c= 3
参考答案:
D 展开
Command1
,然后编写如下程序:
Function Func(ByVal x As Integer, y As Integer)
y = x * y
If y > 0 Then
Func = x
Else
Func = y
End If
End Function
Private Sub Command1_Click()
Dim a As Integer, b As Integer
a = 3
b = 4
c = Func(a, b)
Print "a="; a
Print "b="; b
Print "c="; c
End Sub
程序运行后,单击命令按钮,其输出结果为:
______
A:a= 3 b= 4 c= 12
B:a= 13 b= 12 c= 12
C:a= 3 b= 4 c= 3
D:a= 3 b= 12 c= 3
参考答案:
D 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询