首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下面的程序代码: Private Sub Command1_Click() Print fun(748639,5) End Sub Private Function fun(x As Long,a As Integer)As Integer Dim n
阅读下面的程序代码: Private Sub Command1_Click() Print fun(748639,5) End Sub Private Function fun(x As Long,a As Integer)As Integer Dim n
admin
2020-07-22
27
问题
阅读下面的程序代码:
Private Sub Command1_Click()
Print fun(748639,5)
End Sub
Private Function fun(x As Long,a As Integer)As
Integer
Dim n As Long
n=1
Do
n=n*10
a=a-1
Loop Until a=0
fun=hat((x Mod n)/(n/10))
End Function
此程序代码运行后的输出是( )。
选项
A、3
B、4
C、48639
D、74863
答案
B
解析
主调过程Command1_Click中调用函数过程fun,并将整数748639传递给形参x,将5传递给形参a,被调过程fun中循环执行情况及各变量的值如下表所示。
x mod n=748639 mod 100000=48639:n/10=100000/10=10000;故表达式Int((x Mod n)/(n/10))结果为Int(48639/10000)=4;所以B选项正确。
转载请注明原文地址:https://kaotiyun.com/show/nMHp777K
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
在窗体上画一个名称为Text1的文本框,并编写如下程序:OptionBase1PrivateSubForm_Click() Dimarr DimStartAsInteger,FinishAsInteger DimSu
如果改变驱动器列表框的Drive属性,则将触发的事件是( )。
软件测试用例包括()。
在列表框或组合框中,能够表示当前被选中列表项序号的是
计算下面分段函数的正确语句是()。
窗体上有名称为Commandl的命令按钮和名称为Textl的文本框()。PrivateSubCommandl_Click()Textl.Text=“程序设计”Textl.SetFocusEndSubPrivateSub
窗体如图所示。其中载体汽车图案的是Imagel图形框,直线的名称是Linel,另有一个定时器,名称为Timerl。已经编写了下面的程序代码:PrivateSubForm_Click()Timer1.Enabled=TrueEn
工程文件中包含一个模块文件和一个窗体文件。模块文件的程序代码是:PublicxAsIntegerPrivateYAsInteger窗体文件的程序代码是:DimaAsIntegerPrivateSubForm_Load0
下列描述中,不符合良好程序设计风格要求的是
检查软件产品是否符合需求定义的过程称为
随机试题
A.秩边、委中B.百会、率谷C.肩髑、外关D.风门、膈俞宜用毫针平刺的腧穴是
有关SARS-CoY的描述,正确的是
盐酸吗啡分子结构中有多个手性碳原子,其位置和构型错误的是
A.经前诊刮为增生期子宫内膜B.经前诊刮为正常分泌期子宫内膜C.月经第5天诊刮为增生与分泌期子宫内膜D.经前诊刮为分泌不良子宫内膜E.经前诊刮为不典型增生子宫内膜黄体功能不全患者子宫内膜为
某企业2003年所得额为-40万元,2004年所得额为42万元,则2004年应纳所得税( )元。
()fromthetopofthetower,thesouthfootofthemountainisaseaoftrees.
在波士顿矩阵分析模型中,明星类业务的基本特征是()。
Ofallthecutstopublicservices,fewhaveprovokedsuchloudprotestsasproposalstocloselibraries.Petitionsandcursesh
最适合在共用电话交换网(PSTN)上实时传输视频数据的标准是1._____,DVD中视频的编码规范符合2._____标准。2._____A.MPEG-1B.MPEG-2C.MPEG-4D.MPEG-7
Whatwillthewomanspendtheeveningdoing?Listenagaintopartoftheconversation.Thenanswerthequestion.Whatdidthew
最新回复
(
0
)