首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下函数过程: Function Fun (By Val x As Ingeger, ByVal y As Integer)As Integer Do While…y<>0 reminder=x Mod y
有如下函数过程: Function Fun (By Val x As Ingeger, ByVal y As Integer)As Integer Do While…y<>0 reminder=x Mod y
admin
2013-04-11
28
问题
有如下函数过程: Function Fun (By Val x As Ingeger, ByVal y As Integer)As Integer Do While…y<>0 reminder=x Mod y x=y y=reminder Loop Fun=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100:b=25 x=Fun(a,b)Print x End Sub
选项
A、0
B、25
C、50
D、100
答案
2
解析
本题的难点是子函数调用过程。子函数Fun的功能是求x和y的公约数,由“欧几里德”求最大公约数的算法可知,当余数r为0时,x为x和y的最大公约数。变量,的值通过子函数名Fun返回。
转载请注明原文地址:https://kaotiyun.com/show/cnQp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
(1)在考生文件夹中有一个工程文件sj3.vbp,相应的窗体文件为sj3.frm。在在名为Forml的窗体上有一个命令按钮,其名称为Cmdl,标题为“输入”;还有一个文本框,其名称为Textl,初始内容为空白。程序运行后,单击“输入”命令按钮,显示“输入”
在考生文件夹下有一个工程文件sj5.vbp,窗体上有一个文本框,名称为Textl,可以多行显示。还有三个命令按钮,名称分别为Commandl、Command2和Command3,标题分别为“读取数据”、“显示并保存奇数”和“显示并保存偶数”。“读取数据”按
设窗体上有一个名为Text1的文本框,并编写如下程序:PrivateSubForm_Load()ShowText1.Text=""Text1.SetFocusEndSubPriv
假定有如下事件过程:PrivateSubForm_Cilck()DimxAsInteger,nAsIntegerx=1n=0DoWhilex<28
与8e3ln3数学式子对应的VisualBasic表达式是______。
用树型结构来表示实体之间联系的模型称为______。
数据流的类型有______和事务型。
当计时器控件的______属性为True时,计时器控件的______事件经过一定的时间间隔就发生一次,时间间隔由______属性决定。
请在名为Form1的窗体上建立一个二级下拉菜单,第一级共有两个菜单项,标题分别为“文件”和“编辑”,名称分别为vbFile和VbEdit;在“编辑”菜单下有第二级菜单,含有3个菜单项,标题分别为“剪切”、“复制”和“粘贴”,名称分别为vbCut、VbCop
程序设计语言的基本成分是数据成分、运算成分、控制成分和()
随机试题
能够根据EDTA的酸效应曲线来确定某一金属离子单独被滴定的最高pH值。()
下列不属于计算设备的最佳更新周期的方法的是()
现行资产负债表中设计资产项目排列顺序的依据是资产的
肥儿丸的功效是
沙眼导致睑内翻及倒睫,哪种说法不正确
原始凭证审核的内容包括()。
下列说法中,符合检验批合格质量的规定有( )。
下列不属于小学生研究性学习内容选择要求的是_____。
在考生文件夹下YELLOW文件夹中建立—个名为GREEN的新文件夹。
Youwillhearatalkaboutalostbriefcase.Foreachquestion(23-30),markoneletter(A,BorC)forthecorrectanswer.Afte
最新回复
(
0
)