有如下函数过程:Function Cys(ByVal x As Integer, ByVal y As Integer) As Integer Dim quotients Do While y <> 0 quotients = x / y x = y y = quotients Loop Cys = xEnd Function以下是调用该函数的事件过程,该程序的运行结果是()。Private Sub Command1_Click() Dim a As Integer Dim b As Inte
有如下函数过程:Function Cys(ByVal x As Integer, ByVal y As Integer) As Integer Dim quotients Do While y <> 0 quotients = x / y x = y y = quotients Loop Cys = xEnd Function以下是调用该函数的事件过程,该程序的运行结果是()。Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = 10 b = 2 x = Cys(a, b) Print xEnd Sub
A.0
B.25
C.5
D.100
正确答案:5
Tag:VisualBasic程序设计 函数 过程
时间:2021-11-29 15:20:44
- 上一篇:有如下函数过程:Function secproc(x As Integer, y As Integer, z As Integer) secproc = 3 y + z + 2 xEnd Function Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a = 2: b = 3: c = 4 Print secproc(c, b, a)End Sub该程序的运行结果是()。
- 下一篇:以下是一个能返回数组a中最大数的函数过程代码: Function maxval(a() As Integer) As Integer Dim max% max = 1 For i = 2 To 10 If a(i) > a(max) Then max = i Next i maxval = max End Function Private Sub Command1_Click() Dim x(1 To 10) As Integer For i = 1 To 10 x(i) = Int(Rnd() 1