目录: 标题| 题干| 答案| 搜索| 相关
问题

有下列函数过程:Function funl(ByVal x As Integ


有下列函数过程:Function funl(ByVal x As Integer, ByVal y As Integer) Do While y 0 Reminder=x Mody x=y y=reminder Loop Funl=xEnnd Function在下列按钮单击事件中调用该函数,则该程序的运行结果是 Privatr Sub Commandl_Click() Dim a As IntegerDim b As Integer a=100 b=25 x=funl(a,b) Print x End Sub

  • A0
  • B25
  • C50
  • D100
参考答案
参考解析:

【解析】可以通过两种方式来传递参数,即按值传递参数和按地址传递参数。按值传递参数时,传递的只是变量的副本。如果过程改变了这个值,则所作变动只影响副本而不会影响变量本身。用BayVal关键字指出参数是按值来传递的。按地址传递参数使过程用变量的内存地址去访问实际变量的内容,在将变量传递给过程时,通过过程可永远改变变量值。默认时是按地址传递参数。

分类:其他
相关推荐

1、传递函数(transfer function)

传递函数(transfer function)

2、( 22 )语句 dim a(-3 to 4,3 to 6)as integ

( 22 )语句 dim a(-3 to 4,3 to 6)as integer 定义的数组的元素个数是AA ) 18BB ) 28CC ) 21DD ) 32

3、Function函数有参数传递,并且一定有返回值。

Function函数有参数传递,并且一定有返回值。A正确B错误

4、假定有以下两个过程: Sub S1(ByVal x As Integer,

假定有以下两个过程: Sub S1(ByVal x As Integer, ByVal y As Integer) Dim t As Integer t=K x=y y=t End Sub Sub S2(x As Integer, y As Integer)...

5、下列说明语句定义的数组占()个字节。 Dim a(10) AS Integ

下列说明语句定义的数组占()个字节。Dim a(10) AS IntegerA10B11C44D0

6、有如下函数: Function fun(a As Integer,n As

有如下函数: Function fun(a As Integer,n As Integer)As Integer Dim m AS Integer While a>=n a=a-n:m=m+1 Wend Fun=m End Function 该函数的返回值是...