4,5,2,4
4,4,2,1
5,5,3,3
4,5,2,3
第1题:
有以下程序: #include <stdio.h> #include <string.h> main() { char a[]={'a','b','c','d','e','f','g','h','\0'}; int i,j; i=sizeof(a); j=strlen(a); printf("%d,%d\n",i,j); } 程序运行后的输出结果是( )。
A.9,9
B.8,9
C.1,8
D.9,8
第2题:
有以下程序: #include <string.h> main() {char *p="abcde\Ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是( )。
A.12
B.15
C.6
D.5
第3题:
下列程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() { char a[]="\n123\\"; printf("%d,%d\n",strlen(a),sizeof(a)); }
A.5,6
B.5,5
C.6,6
D.6,5
第4题:
下列程序的输出结果是( )。#include<stdio.h>#include<string.h>main(){ char a[]="\n123\\"; printf("%d,%d\n",strlen(A) ,sizeof(A) );}
A.5,6
B.5,5
C.6,6
D.6,5
第5题:
有以下程序:#include <stdio.h>main( ){ char P[] = {'a','b','c'} ,q[]: "abc"; printf( "% d % d \ n", sizeof(p), sizeof(q) );}程序运行后的输出结果是( )。
A.44
B.33
C.34
D.43
第6题:
有以下程序: #include<stdio.h> #include<string.h> main() { char a[]={'a','b','c','d','e','f','g','h','\0'};int i,j; i=sizeof(a);j=strlen(a); printf("%d,%d\b",i,j);} 程序运行后的输出结果是
A.9,9
B.8,9
C.1,8
D.9,8
第7题:
阅读以下程序,写出程序运行后的输出结果是 ______。 #include<iostream.h> void main(){ char a[]={'H','e','r','1',‘o’,'\0'}; int i, j; i=sizeof(a)/sizeof(char); j=strlen(a) cout<<i<<' '<<j; }
A.6 6
B.5 6
C.1 5
D.6 5
第8题:
● 下面程序运行后的输出结果是 (59) 。
#include <stdio.h>
#include <string.h>
void main()
{
char a[7] = "china";
int i, j;
i = sizeof(a); j = strlen(a);
printf("%d, %d\n", i, j);
}
(59)
A. 5, 5
B. 6, 6
C. 7, 5
D. 7, 6
第9题:
10,6,4,6
11,6,11,6
11,6,1,6
10,7,1,7
第10题:
4,5,2,4
4,4,2,1
5,5,3,3
4,5,2,3
第11题:
9,7,4,7
8,6,9,6
8,6,3,6
10,8,5,8
第12题:
8
9
7
10
第13题:
有以下程序:#include <stdio.h>#include <string.h>main( ) { char a[ 7 ] = "a0 \0a0 \0"; int i,j; i = sizeof(a); j = strlen(a); printf(" % d %d \n" ,i,j); }程序运行后的输出结果是( )。
A.22
B.76
C.72
D.62
第14题:
下列程序在32位linux或unix中的结果是什么?
func(char *str)
{
printf(" %d",sizeof(str));
printf(" %d",strlen(str));
}
main()
{
char a[]="123456789";
printf(" %d",sizeof(a));
printf(" %d",strlen(a));
func(a);
}
10 9 4 9
第15题:
若有如下程序; main() {char a[]="china\0name\0"; printf("%d,",strlen(A) ); printf("%d\n",sizeof(A) ); } 则程序运行后的输出结果是( )
A.5,11
B.5,12
C.11,11
D.12,12
第16题:
下列程序的输出结果是( )。 #include<stdio.h> main() { char a[]= {'a','b','c','d','e','f,'\0'}; int i,j; i=sizeof(a); j=strlen(a); printf("%d,%d",i,j); }
A.7,7
B.7,6
C.6,6
D.6,7
第17题:
有以下程序 #include.<string.h> main() { char *p="abcde\ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是
A.12
B.15
C.6
D.5
第18题:
下列程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() { char a[]="\n123\\"; printf ("%d,%d\n",strlen(a),sizeof(a)); }
A.5,6
B.5,5
C.6,6
D.6,5
第19题:
A.13,13
B.13,14
C.13,15
D.14,15
第20题:
6
7
11
12
第21题:
6
9
11
7
第22题:
6 1
7 0
6 3
7 1
第23题:
7,4
4,10
8,8
10,10
第24题:
13,13
13,14
13,15
14,15