首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下函数过程: Function fun1 (ByVal x As Integer, ByVal y As Integer) As Integer Do While y <> 0 reminder=x Mo
有如下函数过程: Function fun1 (ByVal x As Integer, ByVal y As Integer) As Integer Do While y <> 0 reminder=x Mo
admin
2010-09-11
26
问题
有如下函数过程: Function fun1 (ByVal x As Integer, ByVal y As Integer) As Integer Do While y <> 0 reminder=x Mod y x=y y=reminder Loop fun1=x End Function 在下列按钮单击事件中调节器用该函数,则该程序的运行结果是( )。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=fun1(a,b)Print x End Sub
选项
A、0
B、25
C、5O
D、100
答案
B
解析
可以通过两种方式来传递参数,即按值传递参数和按地址传递参数。按值传递参数时,传递的只是变量的副本。如果过程改变了这个值,则所作变动只影响副本而不会影响变量本身.用ByVel关键字指出参数是按值来传递的。按地址传递参数使过程用变量的内存地址去访问实际变量的内容,在将变量传递给过程时,通过过程可,永远改变变量值.默认时是按地址传递参数。题中fun1函数的参数都是按值传送的,函数使用“过程名=表达式”的形式获得函数的返回值,如愿中“fun1=x”语句。调用函数“x=fun1(s,b)”后,x=25。
转载请注明原文地址:https://kaotiyun.com/show/rWmp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
使用如下()保留字可以使只有在定义该类的包中的其他类才能访问该类。
下面关于数组定义语句不正确的是( )。
Java语言的循环语句包括for语句、do-while语句和do-while语句,先循环后判断,循环至少被执行一次的是______。
下列哪个选项是创建一个标识有“关闭”按钮的语句?
在链表的运算过程中,能够使空表与非空表的运算统一的结构是______。
顺序执行下面两个语句的输出结果为【】。Strings=“全国计算机等级考试”;System.out.println(s.length());
通常,将软件产品从提出、实现、使用维护到停止使用退役的过程称为【】。
使用如下哪一个保留字可以使只有在定义这个类的包中的其他类才能访问此类?______
如下代码定义了一个类Test:classTest{privateinty;Test(intx){y:x;}}现在为Test类生成一个对象,正确的语句是( )。
随机试题
A.基底膜B.蜗管C.鼓阶D.前庭阶内淋巴液所在的部位是
B超胎盘Ⅲ级表示
常用作诱导麻醉的药物是()。
患者男,哮喘急性发作,应给予下列哪个药物
我国的注册咨询工程师(投资)是以()咨询为主,兼顾与投资相关的其他咨询业务和宏观经济建设决策咨询业务。
课堂提问之后,教师对学生的回答给予回应,比如接受学生观点,或口头表扬,或指出回答的不当之处。这种行为被称为()。
In2011,greenhomesmadeuproughly17percentofthemarketandisexpectedtoreachtwooutoffivehomesby2016,according
RAM的特点是()。
A=TheImperialPalaceB=TheTempleofHeavenC=PotalaPalaceD=JokhangTempleWhichpalaceortemple...isthespiritualc
Whatispapermade?Whenwe【C1】________booksornewspapers,weseldomstopandthinkaboutthethings【C2】________tomakethem.【
最新回复
(
0
)