首页 > 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

有以下程序 fun(intx,inty,intz) {z=x*y;} main() {inta=4,b=2,c=6; fun(a,b,c); print

有以下程序

fun(int x,int y,int z)

{ z=x*y;}

main()

{int a=4,b=2,c=6;

fun(a,b,c);

printf("%d",c);

}

程序运行后的输出结果是

A.16

B.6

C.8

D.12

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序 fun(intx,inty,intz) {z=x…”相关的问题
第1题
以下程序的输出结果是【11】。 intfun(intx,inty,int*p,int*q) {*p=x*y; *q=x/y;} main()

以下程序的输出结果是 【11】 。

int fun(int x,int y,int *p,int *q)

{ *p=x*y;

*q=x/y;}

main()

{int a,b,c,d;

a=4;b=3;

fun(a,b,&c,&d);

printf("%d,%d\n",c,d);}

点击查看答案
第2题
下列程序运行后的输出结果是()。#includeusingnamespacestd;intfun(intx){returnx*x;}doublefun(doublex,inty=2){returnx*y;}intmain(){inta=5;doubleb=1.2;cout<<fun(a)+fun(b)<<endl;return0;}

A.27.4

B.26.44

C.12.4

D.程序有误

点击查看答案
第3题
有下列程序: #include<stdi0.h>intf(intx){inty; if(x==0‖x==1)return(3); y=x*x-f(X-2);

有下列程序:

#include<stdi0.h>

intf(intx)

{

inty;

if(x==0‖x==1)return(3);

y=x*x-f(X-2);

returny;

}

voidmain()

{

intZ;

z=f(3);printf("%d\n",z);

}

程序的运行结果是()。

A.0

B.9

C.6

D.8

点击查看答案
第4题
以下两行代码能否出现在一起?()struct{intx;inty;}x;struct{intx;inty;}y;

A.能

B.不能

C.以上都不对

D.写法有问题

点击查看答案
第5题
有如下程序#includeusingnamespacestd;intmax(intx,inty){intz;if(x>y)z=x;elsez=y;returnz;}intmain(){inta=3,b=5;cout<<"max="<<max(a,b)<<endl;}

A.max=3

B.max=4

C.max=5

D.max=6

点击查看答案
第6题
有以下程序: classDate { public: Date(inty,intm,intd); { year=Y: month=m; day=d; } Da

有以下程序: classDate { public: Date(inty,intm,intd); { year=Y: month=m; day=d; } Date(inty=2000) { year=y; month=10; day=1; } Date(Date&d)

{ year=d.year; month=d.month; day=d.day; } voidprint() { cout<<year<<"."<(month<<"."<<day<<endl; } private: intyear,month,day; }; Datefun(Dated) { Datetemp; temp=d; returntemp; } intmain() { Datedatel(2000,1,1),date2(0,0,0); Datedate3(datel); date2=fun(date3); return0; } 程序执行时,Date类的拷贝构造函数被调用的次数是()。

A.2

B.3

C.4

D.5

点击查看答案
第7题
有以下程序: classDate {public: Date(inty,intm,intd); {year=Y; month=m; day=d;} Date(i

有以下程序: classDate {public: Date(inty,intm,intd); {year=Y; month=m; day=d;} Date(inty=2000) {year=y; month=10; day=1;} Date(Date&d) {year=d.year; month=d.month; day=d.day;} voidprint() {cout<<year<<"."<<month<"."<< day<<endl;} private: intyear,month,day;}; Datefun(Dated) {Datetemp; temp=d; returntemp;} intmain() {Datedatel(2000,1,1),date2(0,0,O); Datedate3(date1); date2=fun(date3); return0;} 程序执行时,Date类的复制构造函数被调用的次数是()。

A.2

B.3

C.4

D.5

点击查看答案
第8题
有如下程序: #include<iostream> usingnamespacestd; voidf1(int&X,int&y){intz=x;x=y;y

有如下程序: #include<iostream> usingnamespacestd; voidf1(int&X,int&y){intz=x;x=y;y=z;}voidf2(intX,inty){intz=x;x=y;y=z;}intmain(){ intx=10,y=26; f1(x,y); f2(x,y); cout<<y<<endl; return0; } 运行时的输出结果是()。

A.10

B.16

C.26

D.36

点击查看答案
第9题
有以下程序:fun (inta,intb){if (a>b)return (a); elsereturn(b);} main (){intx=3,y=8,z=6,r;r

有以下程序: fun (int a, int b) { if (a>b) return (a); else return(b); } main () { int x=3, y=8, z=6, r; r=fun(fun(x,y) , 2*z); printf("%d\n", r); } 程序运行后的输出结果是

A.3

B.6

C.8

D.12

点击查看答案
第10题
下面程序输出的结果是()

A.intx=10

B.inty=x++

C.out<

D.11,10

E.11,11

F.10,11

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改