[单选题]

设有Function过程:

Private Function f(a As Integer, b As Integer) As Integer

a = a * a:

b = b * b

f = CInt(Sqr(a - b))

E.nd Function

则如下程序段的运行结果是( )。

Private Sub Command1_Click()

D.im X As Integer, Y As Integer

X = 5: Y = 4

a = f(X, Y)

Print a

E.nd Sub

A. 5

B. 4

C. 3

D. 9

参考答案与解析:

相关试题

设有以下函数过程Private Function Fun(a()As Integ

[单选题]设有以下函数过程Private Function Fun(a()As Integer,b As String)As IntegerE.hd Function若已有变量声明:D.im 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)

  • 查看答案
  • (23)设有以下函数过程Private Function Fun(a() As

    [单选题](23)设有以下函数过程Private Function Fun(a() As Integer, b As String) As Integer...E.nd Function若已有变量声明:D.im 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)

  • 查看答案
  • 设有如下通用过程:Public Function f(x As Integer)

    [单选题]设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x = 20 y = 2 f = x * y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Commandl Click() Static x As Integer x = 10 y = 5 y = f(x) Print x;y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是A.10

  • 查看答案
  • 设有如下通用过程:Public Function f(x As Integer)

    [单选题]设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x=20 y=2 f=x*y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Static x As Integer x=10 y=5 y=f(x) Print x; y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是______。A.10 5B.20

  • 查看答案
  • 设有如下通用过程:Public Function f(x As Integer)

    [单选题]设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x=20 y=2 f=x*y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程; Private Sub Command1_Click() Static x As Integer x=10 y=5 y=f(x) Print x;y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。A.10 5B.20 5C.

  • 查看答案
  • 如果存在如下过程: Private Function Fun(a() As In

    [试题]如果存在如下过程:Private Function Fun(a() As Integer)D.im First As Integer, Last As Integer, i As IntegerF.irst=LBound(a)Last=UBound(a)Max=a(First)F.or i=First To LastIf a(i) > Max Then Max=a(i)NextF.un=MaxE.nd Function在窗体上添加一个命令按钮,然后编写如下事件过程:Private Sub C

  • 查看答案
  • ( 25 )设有以下函数过程Function fun(a As Integer,

    [单选题]( 25 )设有以下函数过程F.unction fun(a As Integer,b As Integer)D.im c As IntegerIf a<b Thenc=a:a=b:b=cE.nd Ifc=0D.oc=c+aLoop Until c Mod b=0fun=cE.nd function若调用函数 fun 时的实际参数都是自然数,则函数返回的是A. ) a 、 b 的最大公约数B. ) a 、 b 的最小公倍数C. ) a 除以 b 的余数D. ) a 除以 b 的商的整数部分

  • 查看答案
  • 设有以下函数过程:Function fun(a As Integer,b As

    [单选题]设有以下函数过程:F.unction fun(a As Integer,b As Integer)D.im c As IntegerIf a<b Thenc=a:a=b:b=CE.nd IFc=0D.oc=c+aLoop Until c Mod b=0fun=cE.nd Function若调用函数fun时的实际参数都是自然数,则函数返回的是( )。A.a、b的最大公约数B.a、b的最小公倍数C.a除以b的余数D.a除以b的商的整数部分

  • 查看答案
  • 设有以下函数过程:Function fun(a As Integer,b As

    [单选题]设有以下函数过程:F.unction fun(a As Integer,b As Integer)D.im c As IntegerIf a<b Thene=a:a=b:b=cE.nd Ifc=0D.oc=C+aroop Until c Mod b=0fun=cE.nd Function若调用函数fun时的实际参数都是自然数,则函数返回的是A.a、b的最大公约数B.a、b的最小公倍数C.a除以b的余数D.a除以b的商的整数部分

  • 查看答案
  • 阅读下面程序Private Function a (load As Intege

    [试题]阅读下面程序Private Function a (load As Integer)As SingleIf loud<20 thenmoney=lnad/2elsemoney=20+loadend ifa=moneyE.nd FunctionPrivate Sub Form_Click()D.im load As Integer,fee As SingleLoad=InputBox("请输入一个数:")F.ee=a(loa@D@Print feeE.nd Sub运行后的输出结果是[ ]。

  • 查看答案
  • 设有Function过程:Private Function f(a As Int