以下程序段运行后屏幕输出为() chara[]="abc/0mis"; printf("%d",strlen(a));
第1题:
有以下程序 #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.9
B.6
C.11
D.7
第2题:
有以下程序: #include<stdio.h> #include<strin9.h> main( ) {printf{"%d\n",strlen("%d\n",strlen("ATS\n012\|"));} 程序运行后的输出结果是( )。
A.3
B.8
C.4
D.9
第3题:
以下程序段的输出结果是 char s[]="\\141\141abc\t"; printf ("%d\n",strlen(s));
A.9
B.12
C.13
D.14
第4题:
有以下程序 #include<string.h> main() { char *p=“abcde、Ofghjik\0”; printf(“%d\n”,strlen(p)); } 程序运行后的输出结果
A.12
B.15
C.6
D.5
第5题:
有以下程序: #include <string.h> main() {char *p="abcde\Ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是( )。
A.12
B.15
C.6
D.5
第6题:
A.c
B.z
C.\0
D.d
第7题:
有以下程序
# 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.9
B.6
C.11
D.7
第8题:
有以下程序:
include<stdio.h>
include<strin9.h>
main( )
{printf{"%d\n",strlen("%d\n",strlen("ATS\n012\|"));}
程序运行后的输出结果是( )。
A.3
B.8
C.4
D.9
本题考查strlen函数和转移字符,strlen函数的功能是求字符串的长度,在本题中有“\”,C语言中“\”是转义字符,在计算长度时会将转义符以及后面的第一个字符作为1个长度进行计算,所以答
第9题:
若有定义:chara[]="abcdef";charb[]="xyz";则以下程序段运行后屏幕输出为() strcpy(a,b); printf("%c",a[2]);
第10题:
若有以下程序段:charstr[]=”ab/n/012///””;printf(“%d”,strlen(str));该程序段的输出结果是()
第11题:
c
z
/0
d
第12题:
第13题:
有以下程序: main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"); printf("%d\n", strlen(p[4])); } 执行后输出结果是( )。
A.2
B.3
C.4
D.5
第14题:
有以下程序: main( ) { char * p[10]={"abc","aabdfg","dcdbe","abbcf',"cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是 ______。
A.2
B.3
C.4
D.5
第15题:
有以下程序段 main() { char a[7]="abcdef"; charb[4]="ABC"; strcpy(a,b) ; printf("%c",a[5]); } 程序段运行后的输出结果是( )
A.a
B.\0
C.e
D.f
第16题:
有以下程序
#include <stdio.h>
#include <string.h>
main( )
{ printf("%d\n",strlen ("ATS\n012\1") ); }
程序运行后的输出结果是
A)3
B)8
C)4
D)9
第17题:
A.5
B.8
C.3
D.4
第18题:
有以下程序
#include
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.9
B.6
C.11
D.7
第19题:
以下程序片段的输出结果是______。 char str[]="abc\n\012\\\""; printf("%d",strlen(str));
A.4
B.5
C.6
D.7
第20题:
有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是( )。
A.2
B.3
C.4
D.5
第21题:
以下程序段的输出结果是()。 Char s[]I=”/1238/080abc”; printf(”%d/n”,strlen(s));
第22题:
5
8
3
4
第23题:
6
9
11
7