首页 > 考研
题目内容 (请给出正确答案)
[单选题]

若有如下程序,则程序运行结果为:()#include<stdio. h>main(){ int x=1, a=0;switch (x)case 1:a++;case 2: a++ ;break;case 3: a++ ; break;printf(”a=%d\n" ,a)

A.=0

B.=1

C.=2

D.=3

答案
收藏

D、=3

如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“若有如下程序,则程序运行结果为:()#includemain…”相关的问题
第1题
若有如下程序: main() { int x=4,y=1; printf("%d\n",sub(x,sub(x,y))); }

若有如下程序: main() { int x=4,y=1; printf("%d\n",sub(x,sub(x,y))); } sub(int i,int j) { static int a=0; int b=2; a+=i+b; b+=j+a; } 则程序运行后的输出结果是【 】。

点击查看答案
第2题
若有如下程序,则程序运行后向x,y,z的值为:()int x=10,y=20,z= =30; .if(x>y)Z= X;x=y;y=z

A.x=10, y=20, z=30

B.x=20, y=30, z=30

C.x=20, y=30, z=10

D.x=20, y=30, z=20

点击查看答案
第3题
若有如下程序: main() {int x=4,y=3,x=2,t; t=x<y<z; printf("%d\n",t);} 则程序运行

若有如下程序: main() {int x=4,y=3,x=2,t; t=x<y<z; printf("%d\n",t);} 则程序运行后的输出结果是【 】。

点击查看答案
第4题
若有如下程序: main() {int a[][2]={1,2,6,9,11},(*t)[2]; t=a; printf("%d,%d\

若有如下程序: main() {int a[][2]={1,2,6,9,11},(*t)[2]; t=a; printf("%d,%d\n",*(t[1]+1), (*t) [1]); } 则程序运行后输出的结果是【 】。

点击查看答案
第5题
若有如下程序: sub(int*y) {while(--(*y)); printf("%d",(*y)--);} main()

若有如下程序: sub(int*y) {while(--(*y)); printf("%d",(*y)--);} main() { int x=10; sub(&x); } 则程序运行后的输出结果是【 】。

点击查看答案
第6题
若有如下程序: void sub() {static int x=6; x/=2;printf("%d",x); } main()

若有如下程序: void sub() {static int x=6; x/=2;printf("%d",x); } main() {int m; for(m=0;m<=2;m++) sub(); } 则程序运行后的输出结果是【 】。

点击查看答案
第7题
若有如下程序: void sub() { static int x=8; x/=2;printf("%d",x); }

若有如下程序: void sub() { static int x=8; x/=2;printf("%d",x); } main() { int m; for(m=0;m<2;m++) sub();} 则程序运行后的输出结果是【 】.

点击查看答案
第8题
若有如下程序: main() {int x=4;y=3,Z=2,t; t=x<y<z; printf("%d\n",t); }

若有如下程序: main() {int x=4;y=3,Z=2,t; t=x<y<z; printf("%d\n",t); } 则程序运行后的输出结果是【 】。

点击查看答案
第9题
若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); st

若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); strcpy(&s[1],"de"); strcpy(&s[2],"f"); printf("%s\n",s); } 则程序运行后的输出结果是【 】。

点击查看答案
第10题
若有如下程序: main() { int s=8,a=3,b=5,c=6; if(a>b) s=a; a=b; b=s; if(a>c

若有如下程序: main() { int s=8,a=3,b=5,c=6; if(a>b) s=a; a=b; b=s; if(a>c) {s=a; a=c;b=s); if(b>c) s=b; b=c;c=s; printf("%d,%d,%d\n",a,b,c); } 则程序运行后的输出结果是【 】。

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