网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
有以下程序(strcat函数用以连接两个字符串):#include #include main(){ char a[20]=ABCD\0EFG\0, b[]=IJK; strcat(a,b); printf(%s,a);}程序运行后的输出结果是(  )。
A

ABCDE\0FG\0IJK

B

ABCDIJK

C

IJK

D

EFGIJK


参考答案

参考解析
解析:
在C语言中,系统在每个字符串的最后自动加入一个字符'\0'作为字符串的结束标志。char a[20] = "ABCD\0EFG\0"中,当遇到'\0'就结束初始化,因此a[] = "ABCD",b[] = "IJK",连接这两个字符串strcat(a,b)得到ABCDIJK。答案选择B选项。
更多 “单选题有以下程序(strcat函数用以连接两个字符串):#include #include main(){ char a[20]=ABCD\0EFG\0, b[]=IJK; strcat(a,b); printf(%s,a);}程序运行后的输出结果是(  )。A ABCDE\0FG\0IJKB ABCDIJKC IJKD EFGIJK” 相关考题
考题 有以下程序#include stdio.hmain(){ char *a[]={"abcd","ef","gh","ijk"};int i;for(i=0;i4;i++) printf("%c",*a[i]);}程序运行后的输出结果是A)aegiB)dfhkC) abc dD)abcdefghijk

考题 (31)有以下程序#include stdio.hmain(){ char *a[ ]={“abcd”,”ef”,”gh”,”ijk”};int I;for (i=0;i4;i++) printf(“%c”,*a);}程序运行后输出的结果是A)aegi B)dfhk C)abcd D)abcdefghijk

考题 有以下程序 include main() { char p[20]={'a','b','c','d'},q[]="abc",r[] 有以下程序 #include<string.h> main() { char p[20]={'a','b','c','d'},q[]="abc",r[]="abcde"; strcpy(p+strlen(q),r);strcat(p,q); printf("%d%d\n",sizeof(p),strlen(p)); } 程序运行后的输出结果是A.20 9B.9 9C.20 11D.11 11

考题 有以下程序 include main() { char p[20]={'a','b','c','d'},q[]="abc",r[] 有以下程序 #include<string.h> main() { char p[20]={'a','b','c','d'},q[]="abc",r[]="abcde"; strcat(p,r);strcpy(p+strlen(q),q); printf("%d\n",strlen(p)); } 程序运行后的输出结果是A.9B.6C.11D.7

考题 有以下程序:includemain(){char p[20]={'a','b','c','d'),q[]="abc",r[]="abcde"strc 有以下程序: #include<string.h> main() {char p[20]={'a','b','c','d'),q[]="abc",r[]="abcde" strcat(p,r);strcpy(p+strlen(q),q); printf("%d\n",sizeof(p)); } 程序运行后的输出结果是( )。A.9B.6C.11D.7

考题 有以下程序(strcat函数用以连接两个字符串) #includestdio.h #includestring.h。 main {char a[20]="ABCD\oEFG\0",h[]="IJK"; strcat(a,b);printf("%s\n",a); ) 程序运行后的输出结果是( )。A.ABCDE\0FG\0IJKB.ABCDIJKC.IJKD.EFGIJK

考题 有以下程序: include main( ) {char s[ ] ="159" , * p;p=s;printf( "% c", * p + + 有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。A.15B.16C.12D.59

考题 有下面程序段 #include"stdio.h" #include"string.h" main() { char a[3][20]={{"china"},{"isa"},{"bigcountry!"}}; chark[100]={0},*p=k; int i; for(i=0;i<3;i++) {p=strcat(p,a[i]);} i=strlen(p); printf("%d\n","i);} 则程序段的输出结果是A.18B.19C.20D.21

考题 有以下程序includemain(){char*a[]={"abcd","ef","gh","ijk"};int i; for(i=0;i 有以下程序 #include<stdio.h> main() { char*a[]={"abcd","ef","gh","ijk"}; int i; for(i=0;i<4;i++) printf("%c",*a[i]); } 程序运行后的输出结果是______。A.ageiB.dfhkC.abcdD.abcdefghijk

考题 以下程序运行后的输出结果是( )。 include main() { int x=20; printf("%d", 0 以下程序运行后的输出结果是( )。include<stdio.h>main(){ int x=20;printf("%d", 0<x<20);printf("%d\n", 0<x x<20);}

考题 以下程序运行后的输出结果是( )。 include main() {char ch[]="abcd",x[4][4];int i; f 以下程序运行后的输出结果是( )。 include<string.h> main() {char ch[]="abcd",x[4][4];int i; for(i=0;i<4;i++)strcpy(x[i],ch); for(i=0;i<4;i++)printf("%s",x[i][i]); printf("\n"); }

考题 有以下程序:includemain(){char *p="abcde\Ofghjik\0";printf("%d\n",strlen(p));}程 有以下程序: #include <string.h> main() {char *p="abcde\Ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是( )。A.12B.15C.6D.5

考题 以下程序:includeincludemain(){char str[]="abcd\n\123\xab";printf("%d" 以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd\n\123\xab"; printf("%d",(str)); } 运行后的输出结果是( )。A.10B.9C.7D.14

考题 有以下程序(strcat函数用于连接两个字符串):程序运行后的输出结果是( )。A.U-KB.ABCDE\0FG\0UKC.ABCDUKD.EFGUK

考题 有以下程序# include string.hmain(){char p[20]={′a′, ′b′, ′c′, ′d′}, q[]="abc", r[]="abcde";strcat(p, r); strcpy(p+strlen(q), q);printf("%d\n",strlen(p));}程序运行后的输出结果是A.9B.6C.11D.7

考题 有以下程序include.main(){char*p="abcde\ofghjik\0";printf("%d\n",strlen(p));} 程 有以下程序 #include.<string.h> main() { char *p="abcde\ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是A.12B.15C.6D.5

考题 有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数): #includestdio.h #includestring.h main( ) {char a[10]="abc",b[10]="012",c[10]="xyz"; strcpy(a+1,b+2); puts(strcat(a,c+1)); } 程序运行后的输出结果是( )。A.al2xyzB.12yzC.a2yzD.bc2yz

考题 有以下程序(strcat函数用以连接两个字符串)#includestdio.h#includestring.hmain( ){char a[20]=”ABCD\0EFG\0”,b[]=”IJK”;strcat(a,b);printf(”%s\n”,a);}程序运行后的输出结果是( )。A.ABCDE\0FG\0IJKB.ABCDIJKC.IJKD.EFGIJK

考题 有以下程序: include main( ) { char *p="abcde\0ghjik\0"; printf("%d\n",str 有以下程序: #include<string.h> main( ) { char *p="abcde\0ghjik\0"; printf("%d\n",strlen(p) ); } 程序运行后的输出结果是A.12B.15C.6D.5

考题 有以下程序: include main() { char p[20]={'a','b','c','d'},q[]="abc",r[]="abcde" 有以下程序: #include <string.h> main() { char p[20]={'a','b','c','d'},q[]="abc",r[]="abcde"; strcat(p,r); strcpy(p+strlen(q),q); printf("%d\n",strlen(p)); } 程序运行后的输出结果是( )。A.9B.6C.11D.7

考题 有下面程序段 #include"stdio.h" #include"string.h" main() { char a[3][20]={{"china"};{"isa"},{bigcountry!"}}; char k[100]={0},*p=k; int i; for(j=0;j<3;i++) { p=strcat(p,a[i]);} i=strlen(p); printf("%d\n",i);} 则程序段的输出结果是A.18B.19C.20D.21

考题 执行下列程序的输出结果是()。  #include   #include    main( )  {   char a[80]=“AB”, b[80]= “LMNP”;       int i=0;      strcat(a,b);      while(a[i++]!=‘/0’)          b[i]=a[i];  puts(b); }

考题 单选题有以下程序#include #include main(){ char p[20]= {'a','b','c','d'}, q[]=abc, r[]=abcde; strcat(p,r); strcpy(p+strlen(q),q); printf(%d,strlen(p));}程序运行后的输出结果是(  )。A 6B 9C 11D 7

考题 单选题有以下程序:#include #include main(){ char a[20]=ab,b[20]=cdef; int k=0; strcat(a,b); while(a[k]!='\0') {  b[k]=a[k];  k++; } puts(b);}程序的运行结果是(  )。A abcdefB cbcdefC cdefD ab

考题 单选题有以下程序(strcpy为字符串复制函数,strcat为字符串连接函数): #include #include main() {  chara[10]=abc,b[10]=012,c[10]=xyz;  strcpy(a+1,b+2);  puts(strcat(a,c+1)); } 程序运行后的输出结果是(  )。A a12xyzB 12yzC a2yzD bc2yz

考题 单选题有以下程序:#include main(){  char *s[6]={ABCD,EFGH,IJKL,MNOP,QRST,UVWX},**p; int i; p=s;  for(i=0;i4;i++)printf(%s,p[i]); printf();}程序运行后的输出结果是(  )。A ABCDEFGHIJKLMNOPB ABCDEFGHHKLC ABCDD AEIM

考题 单选题有以下程序:#include main(){ char *a[]={abcd,ef,gh,ijk}; int i; for(i=0;i4;i++)printf(%c,*a[i]);}程序运行后的输出结果是(  )。A aegiB dfhkC abcdD abcdefghijk