题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-12 13:07:46

[单选题]下面程序的输出结果是()。 #include #include main() { char *p1="abc",*p2="ABC",str[50]= "xyz"; strcpy(str+2,strcat(p1,p2)); printf("%s\n",str);}
A.xyzabcABC
B.zabcABC
C.xyabcABC
D.yzabcABC

更多"[单选题]下面程序的输出结果是()。 #include #includ"的相关试题:

[单选题]下列程序的输出结果是 ( )。 #include "stdio.h" main() { int i,a=0,b=0; for(i=1;i<10;i++) { if(i%2==0) {a++; continue;} b++;} printf("a=%d,b=%d",a,b); }
A.a=4,b=4
B. a=4,b=5
C. a=5,b=4
D. a=5,b=5
[单选题]有以下程序 #include "stdio.h" void main() { char s[12]= "a book"; printf("%.4s",s); } 执行后的输出结果是( )。
A.a book!
B.a book![四个空格]
C.a bo
D.格式描述错误,输出不确定
[单选题]有以下程序 #include main() { char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′}; printf("%d%d\n",strlen(p),strlen(q));} 以下叙述中正确的是 ( )。
A.在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3
B. 由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3
C.由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3
D.由于p和q数组中都没有字符串结束符,故长度都不能确定
[单选题]有以下程序 #include main() {char ch[3][5]={“AAAA”,”BBB”,”CC”}; printf(“%s\n”,ch[1]); } 程序运行后的输出结果是()。
A.AAAA
B. CC
C.BBBCC
D. BBB
[单选题]下列程序执行后的输出结果是()。 main() { char x=0xFFFF; printf("%d \n",x--); }
A.-32767
B.FFFE
C.-1
D.-32768
[单选题]下列程序段的输出结果是:   int data=0;   char k='a',p='f';   data=p-k;   system.out.println(data);
A.0
B.a
C.f
D.5
[单选题]若有以下程序段,输出结果是( )。 char s[ ]="\\141\141abc\t"; printf ("%d\n",strlen(s));
A.9
B.12
C.13
D.14
[单选题]下列程序的输出结果是()。 main() { char a[10]={9,8,7,6,5,4,3,2,1,0},*p=a+5; printf("%d",*--p); }
A.非法
B.a[4]的地址
C.5
D.3
[单选题]阅读下面的程序,运行结果是()。 main() { char *str="ABCabcd"; bubble(str,5); printf("\n%s",str); } bubble(str,count) char *str; int count; { int i,j=count; char tmp; while(j-->1) for(i=0;iA.bacdCBA
B.baCBAcd
C.cdbaCBA
D.bCBAacd
[单选题]#include "stdio.h" void main( ) { char str[80]; scanf("%s",str); insert(str); } insert(char s[]) { int i; for(i=strlen(s);i>0;i--) { s[2*i]=s[i]; s[2*i-1]=' '; } printf("%s",s); } 如果输入的字符串是abcd, 则程序的运行结果是 ( ) 。
A. a b c d
B.a c b d
C.a b c d
D.d c b a
[单选题]下面程序的输出结果是 ( )。 main() { int a[10]={1,2,3,4,5,6,7,8,9,10},*p=a; printf("%d\n",*(p+2));}
A.3
B.4
C.1
D.2
[单选题]以下程序输出结果是 。 #include "stdio.h" void f (); main() {int a; for(a=1;a<=3;a++) fun(); } void fun() {static int i=1; i+=3; printf("%2d",i); }
A.4 7 10
B.4 4 4
C.4 5 6
D.4 6 8
[单选题]下面的程序段运行后,输出结果是 (  )。 int i,j,x=0; static int a[8][8]; for(i=0;i<3;i++) for(j=0;j<3;j++) a[i][j]=2*i+j; for(i=0;i<8;i++) x+=a[i][j]; printf("%d",x);
A.9
B.不确定值
C.0
D.18
[单选题]下面程序输出数组中的最大值,由s指针指向该元素. main() { int a[10]={6,7,2,9,1,10,5,8,4,3,},*p,*s; flr(p=a, s=a; p-a<10; p++) if(_________)s=p; printf("The max:%d",*s): } 则在if语句中的判断表达式应该是()。
A.p>s
B.*p>*s
C.a[p]>a[s]
D.p-a>p-
[单选题]若int x;且有下面的程序片断,则输出结果是() 。 for (x=3; x<6; x++) { printf((x%2) ? "##%d" : "**%d\n", x); }
A.##3 **4 ##5
B.**3 ##4 **5
C.**3 ##4**5
D.##3**4 ##5
[单选题]以下程序的输出结果是( ) #define M(x,y,z) x*y+z void main() { int a=1,b=2, c=3; cout<A.19
B.17
C.15
D.12
[单选题]下列程序的输出结果是: public class Test{   public static void main(String[] args){     int [] array={2,4,6,8,10};     int size=6;     int result=-1;     try{       for(int i=0;iA.Catch---1
B.Catch---2
C.Catch---3
D.以上都不对

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码