网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
有如下一个函数过程: Function Fun(a As Integer) Static c b=0:b=b+1:c=c+1 Fun=a+b+c End Function 在窗体上添加一个命令按钮,事件过程如下: Private Sub Command1_Click() Dim a As Integer a=2 For i=1 To 3 Print Fun(a); Next End Sub 运行该程序,单击命令按钮,输出结果是
A.4 4 4
B.4 5 6
C.6 7 8
D.4 7 9
参考答案
更多 “ 有如下一个函数过程: Function Fun(a As Integer) Static c b=0:b=b+1:c=c+1 Fun=a+b+c End Function 在窗体上添加一个命令按钮,事件过程如下: Private Sub Command1_Click() Dim a As Integer a=2 For i=1 To 3 Print Fun(a); Next End Sub 运行该程序,单击命令按钮,输出结果是A.4 4 4B.4 5 6C.6 7 8D.4 7 9 ” 相关考题
考题
有如下函数过程:Function Fun(By Val x As Ingeger,ByVal y As Integer) As IntegerDO While …y<>0reminder=x Mod yx=yy=reminderLoopFun=xEnd Function以下是调用该函数的事件过程,该程序的运行结果是Private Sub Command1_Click()Dim a As IntegerDim b As Integera=100:b=25x=Fun(a,B)Print xEnd SubA.0B.25C.50D.100
考题
( 29 )有如下函数:Function fun(a As Integer,n As Integer) As IntegerDim m As IntegerWhile a =na=a-nm= m+1Wendfun=mEnd Function该函数的返回值是A ) a 乘以 n 的乘积B ) a 加 n 的和C ) a 减 n 的差D ) a 除以 n 的商(不含小数部分)
考题
( 25 )设有以下函数过程Function fun(a As Integer,b As Integer)Dim c As IntegerIf ab Thenc=a:a=b:b=cEnd Ifc=0Doc=c+aLoop Until c Mod b=0fun=cEnd function若调用函数 fun 时的实际参数都是自然数,则函数返回的是A ) a 、 b 的最大公约数B ) a 、 b 的最小公倍数C ) a 除以 b 的余数D ) a 除以 b 的商的整数部分
考题
设有以下函数过程:Function fun(m As Integer) As IntegerDim k As Integer, sum As Integersum = 0For k = m To 1 Step -2sum = sum + kNext kfun = sumEnd Function若在程序中用语句 s = fun(10) 调用此函数,则s的值为______。
考题
(27)有下列函数过程( )。 Function fun1(By Val x As Integer,By Valy As Integer) As Integer Do While y0 reminder=x Mody x=y y=reminnder Loop Fun1=x End Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是。 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a=100 b=25 x=funl(a,b) Print x End Sub A.0 B.25 C.50 D.100
考题
有如下函数过程: 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 SubA.0B.25C.50D.100
考题
设有以下函数过程 Private Function Fun(a( )As Integer,b As String)As Integer … End Function 若已有变量声明: Dim x(5)As Integer,n As Integer,ch As String 则下面正确的过程调用语句是( )。A.x(O)=Fun(x."ch")B.n=Fun(n.ch)C.CallFun X,"ch"D.n=Fun(x(5),ch)
考题
设有以下函数过程Private Function Fun(a()As Integer,b As String)As IntegerEhd Function若已有变量声明:Dim x(5)As Integer,n As Integer,ch As String则下面正确的过程凋用语句是A.x(0)=Fun(x,“ch”)B.n=Fun(n,ch)C.Call Fun x,“ch”D.n=Fun(x(5),ch)
考题
有如下函数过程: Function funl(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=funl(a,B)Print x End SubA.0B.25C.50D.100
考题
设有以下函数过程: Function fun(a As Integer,b As Integer) Dim c As Integer If ab Then c=a:a=b:b=C End IF c=0 Do c=c+a Loop Until c Mod b=0 fun=c End Function 若调用函数fun时的实际参数都是自然数,则函数返回的是( )。A.a、b的最大公约数B.a、b的最小公倍数C.a除以b的余数D.a除以b的商的整数部分
考题
有如下的程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim P As Integer k=4:m=1 P=Fun(k,m):Print P; P=Fun(k,m):Print P End Sub Private Function Fun(a As Integer,b As Integer) Static m As Integer,i As Integer in=5:i=2 i=i+m+1 m=i+a+b Fun=m\2 End Function 单击命令按钮后,输出结果为A.2 2B.4 4C.5 5D.6 6
考题
有如下函数过程: Function Fun(By Val x As Integer,By Val y As Integer)As Integer Do While Y<>0 reminder=x Mod y x=y y=reminder Loop Fun=x End Function 以下调用函数的事件过程,该程序的运行结果是 Private Sub Command7_Click() Dim a As Integer,b As Integer a=100:b=25 x=Fun(a,B) Print x End SubA.0B.25C.50D.100
考题
有如下一个函数过程: Function Fun(a As Integer) Static C b=0:b=b+1:c=c+1 Fun=a+b+c End Function 在窗体上添加一个命令按钮,事件过程如下: Private Sub Command1_Click() Dim a As Integer a=2 For i=1 To 3 Print Fun(a); Next End Sub 运行该程序,单击命令按钮,输出结果是A.4 4 4B.4 5 6C.6 7 8D.4 7 9
考题
阅读下列程序。 Private Sub Command1_Click() Dim i As Integer,k As Integer k=2 For i=1 To 3 Print Fun(k); Next End Sub Function Fun(j As Integer) Static b a=0 a=a + 1 b=b + 1 Fun=a*b+j End Function 程序运行后,单击命令按钮输出结果是A.234B.345C.567D.356
考题
有如下函数过程。Function Fun(By Val x As Integer,By Val y As Integer)As IntegerDo While y0reminder=x Mod yx=yy=reminderLoopFun=xEnd Function以下调用函数的事件过程,该程序的运行结果是Private Sub Command7_Click()Dim a As Integer,b As Integera=100:b=25x=Fun(a,B)Print xEnd SubA.0B.25C.50D.100
考题
有如下一个函数过程:Function Fun(a As Integer)Static cb=0:b=b+1:c=c+1Fun=a+b+cEnd Function在窗体上添加一个命令按钮,事件过程如下:Private Sub Command1_Click()Dim a As Integera=2For i=1 To 3Print Fun(a);NextEnd Sub运行该程序,单击命令按钮,输出结果是A.4 4 4B.4 5 6C.6 7 8D.4 7 9
考题
有如下函数: 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 该函数的返回值是。 A.a乘以n的乘积 B.a加n的和 C.a减n的差 D.a除以n的商(不含小数部分)
考题
有下列函数过程: 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 aA.0B.25C.50D.100
考题
有如下函数过程。 Function Fun( By Val x As Integer,By Val y As Integer) As Integer Do While y <> 0 reminder = x Mod y xmy y = reminder Loop Fun = x End Function 以下调用函数的事件过程,该程序的运行结果是 Private Sub CommandT_Click( ) Dim a As Integer,b As Integer a = 100:b =25 x =Fun(a,B)Print x End SubA.0B.25C.50D.100
考题
若有如下程序: Private Sub Command1_Click() Dim i As Integer, k As Integer k=2 For i = 1 To 3 Print H(k); Next i End Sub Function H(j As Integer) Static b a=0 a=a+1 b=b+1 H=a*b+j End Function 单击命令按钮,执行程序,输出结果是( )。A.2 3 4B.3 4 5C.5 6 7D.3 5 6
考题
有如下函数过程: Function gys(ByVal x As Integer,ByVal y As Integer) As Integer Do While y<>0 reminder = x Mod y x=y y=reminder Loop gys=x End Function以下是调用该函数的事件过程,该程序的运行结果是______。 Private Sub Command7_Click() Dim s As Integer Dim b As Integer a=100 b=25 x=gys(a,B)Print x End SubA. 0B.25C.50D.100
考题
阅读下列程序: Private Sub Command1_Click() Dim i As Integer,k As Integer k=2 For i=1 To 3 Print Fun(k); Next End Sub Function Fun(j As Integer) Static b a=0 a=a+1 b=b+1 Fun=a*b+j End Function 程序运行后,单击命令按钮输出结果是A.234B.345C.567D.356
考题
有如下函数过程: 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 SubA.0B.25C.50D.100
考题
设有以下函数过程:Function fun(a As Integer,b As Integer)Dim c As IntegerIf a<b Thenc=a:a=b:b=CEnd IFc=0Doc=c+aLoop Until c Mod b=0fun=cEnd Function若调用函数fun时的实际参数都是自然数,则函数返回的是( )。A.a、b的最大公约数B.a、b的最小公倍数C.a除以b的余数D.a除以b的商的整数部分
考题
有如下函数过程: Function HFC(ByVal x AS Integer,ByVal y As Integer)As Integer Do While y < > 0 sic=x/y X=y y=sic Loop HFC=x End Function 以下是该函数的调用过程,该程序的运行结果是 Private Sub Command1 _ Click( ) Dim a AS Integer Dim b As Integer a=12 b=2 x=HFC(a,B)Print x End SubA.0B.6C.2D.80
考题
有如下函数过程: 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 SubA.0B.25C.5OD.100
考题
(23)设有以下函数过程Private Function Fun(a() As Integer, b As String) As Integer...End Function若已有变量声明:Dim x(5)As Integer, n As Integer, ch As String则下面正确的过程调用语句是A)x(o)=Fun(x, "ch")B)n=Fun(n, chC)Call Fun x, "ch"D)n=Fun(x(5), ch)
考题
下列定义Funct函数过程的语句,错误的是()A、Private Public Funct(a)As IntegerB、Static Function Funct(a)C、Private Function Funct(a As Single)D、Function Funct(a As Integer)As Integer
热门标签
最新试卷