首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下面的程序代码: 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
30
问题
阅读下面的程序代码:
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://jikaoti.com/ti/b1S0FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
如果改变驱动器列表框的Drive属性,则将触发的事件是( )。
负责数据库中查询操作的数据库语言是( )。
假定有如下程序:PrivateSubForm_Click()Dima(4)AsInteger,b(4)AsIntegerFork=0To2a(k+1)=Val(InputBox("请
在窗体上建立三个菜单(名称分别为Read、Calc和Save,标题分别为“读入数据”、“计算并输出”和“存盘”),然后添加一个文本框(名称为Text1,可显示多行,ScrollBars属性设置为2)(如图所示)。程序运行后,如果执行“读人数据”命令,则读入
在数据库系统中,给出数据模型在计算机上物理结构表示的是
下列关于栈的叙述中,正确的是
在程序运行时,下面的叙述中正确的是()。
有下面程序代码:PrivateSubCommandl_Click()a=Array(1,2,3,4,5,6,7,8,9,10):n=UBound(a)Fork=0ToUBound(a)/2
设变量x中的值是395,则下面语句的输出是Printx\100+((xMod100)\10)*10+(xMod10)*100
在软件设计中,不属于过程设计工具的是
随机试题
铜带都是冷轧的,分软、硬、半硬状态交货,主要用于()等。
消费品主要采取的国际分销渠道是()
A.强迫观念B.木僵C.痴呆D.情感淡漠E.抑郁状态在意识清晰的情况下,出现全面的智能减退
下列哪位患者发生甲状腺腺癌可能性最大
李先生正在考虑投资三种共同基金。第一种是股票基金;第二种是长期政府债券与公司债券基金;第三种是收益率为8%的短期国库券货币市场基金。这些风险基金的概率分布如表3—5所示。基金的收益率之间的相关系数为0.10。根据案例,回答以下问题。如果某投
下列关于业绩衡量指标的相关计算中,不正确的是()。
简述康熙为巩固统一多民族国家所做出的贡献。
山水画“三远法”最早提出者是_______。
设随机变量X和Y相互独立,且D(X)=4D(Y),则随机变量2X+3Y与2X一3Y的相关系数为________。
OnFebruary10,theworldofpsychiatrywillbeasked,metaphorically,tolieonthecouchandanswerquestionsaboutthestate
最新回复
(
0
)