[单选题]

函数fun1()、fun2()的定义如下所示,已知调用fun1 时传递给形参x的值是-5,若以引用调用(call by reference)的方式调用fun2,则函数fun1的返回值为 (33) ;若以值调用(call by value)的方式调用fun2,则函数fun1的返回值为 (34) 。

fun1(int x) fun2(int x) int a=x-1;

x = fun2(a);

return a-x; x=x+10;

return 3*x;

(33)A. -18 B. -11 C. -8 D. 0

(34)A. -18 B. -11 C. -8 D. 0

参考答案与解析:

相关试题

函数fun1()、fun2()的定义如下所示,已知调用fun1时传递给形参x的值

[单选题]函数fun1()、fun2()的定义如下所示,已知调用fun1时传递给形参x的值是-5,若以引用调用(call by.reference)的方式调用。fun2,则雨数fun1的返回值为( );若以值调用(call by value)的方式调用fun2,则函数funl的返回值为( )。A.-18B.-11C.-8D.O(34)

  • 查看答案
  • 若有如下类定义: class B { void fun1() { protect

    [单选题]若有如下类定义: class B { void fun1() { protected: double var1; public: void fun2() { }, class D: public B protected: void fun3() { };已知obj是类D的对象,下列语句中不违反类成员访问控制权限的是A.obj.fun1();B.obj.varl;C.obj.fun2();D.obj.fun3();

  • 查看答案
  • 有如下类定义: class B{ public: void fun1(){} p

    [单选题]有如下类定义:class B{public: void fun1(){}private: void fun2(){}protected: void fun3(){}};class D: public B{protected: void fun4(){}};若obj是类D的对象,则下列语句中不违反访问控制权限的是( )。A.) obj. fun1();B.) obj. fun2();C.) obj. fun3();D.) obj. fun4();A.B.C.D.

  • 查看答案
  • ( 31 )若有如下类定义 :class B{void fun1(){}prot

    [单选题]( 31 )若有如下类定义 :class B{void fun1(){}protected:double varl;public:void fun2(){}};class D:public B{protected:void fun3(){}};已知 obj 是类 D 的对象,下列句中不违反类成员访问控制权限的是A. ) obj.funl();B. ) obj.varl;C. ) obj.fun2();D. ) obj.fun3();

  • 查看答案
  • 若有如下类定义:class B{void fun1( ){}private:do

    [单选题]若有如下类定义: class B{ void fun1( ){} private: double varl; public: void fun2( ){ } }; class D:public B{ private: void fun3( ){ } }; 已知obj是类D的对象,下列语句中不违反类成员访问控制权限的是A.obj.fun1( );B.obj.varl;C.obj.fun2( );D.obj.fun3( );

  • 查看答案
  • (27)有下列函数过程( )。 Function fun1(By Val x

    [单选题](27)有下列函数过程( )。 Function fun1(By Val x As Integer,By Valy As Integer) As Integer Do While y<>0 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

  • 查看答案
  • 有下列函数过程:Function fun1(ByVal x As Integer

    [单选题]有下列函数过程:F.unction fun1(ByVal x As Integer,ByVal y As Integer)As IntegerD.o While y<>0reminder=x Mod yx=yy=reminderLoopfun1=xE.nd Function 在下列按钮单击事件中调用该函数,则该程序的运行结果是( )。Private Sub Command1_Click()D.im a As IntegerD.im b As Integera=100b=25x=fun1(a,B)

  • 查看答案
  • 有下列函数过程:Function fun1(ByVal x As Integer

    [单选题]有下列函数过程: 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

  • 查看答案
  • 有以下程序 int fun1 (double a){return a*=a;}

    [单选题]有以下程序 int fun1 (double a){return a*=a;} int fun2 (double x,double y) { double a=0,b=0; a=fun1(x);b=fun1(y); return(int)(a+b); } main() {double w;w=fun2(1.1,2.0);......} 程序执行后变量W中的值是______。A.5.21B.5C.5D.0

  • 查看答案
  • 有以下程序:int fun1 (double a){return a * =a;

    [单选题]有以下程序:int fun1 (double a){ return a * =a;}int fun2 ( double x, double y ){ double a=0,b=0; a = fun1 (x) ;b = fun1 (y); return(int) (a + b);} main() { doublew;w=fun2(1.1,2.0);……} 程序执行后变量w中的值是( )。A.5.21B.5C.5D.0

  • 查看答案
  •  函数fun1()、fun2()的定义如下所示,已知调用fun1 时传递给形参