4
3
5
6
第1题:
有以下程序: #include <stdio.h>point ( char * p) { p + = 3; }main( ) char b[4] = {'a','b','c','d'} , *p=b; point(p); printf( "% c \n" , * p);
A.a
B.b
C.c
D.d
第2题:
下列程序执行的输出结果是( )。 #include<stdio.h> main() { char a[2][4]; strcpy(a,"are");strcpy(a [1],"you"); a[0][3]='&'; printf("%s\n",a); }
A.are&you
B.you
C.are
D.&
第3题:
有以下程序 #include <stdio.h> void fun(char **p) { ++p; printf("%s\n",*p); } main() { char *a[]={"Moming","Afternoon","Evening","Night"}; fun(a); } 程序的运行结果是
A.Afternoon
B.fternoon
C.Morning
D.orning
第4题:
下列程序段的输出结果为( )。 #include<stdio.h> main() { static char a[]="language"; char *p; p=a; for(p=a;p<a+8;p+=2) putchar(*p); }
A.language
B.lnug
C.有语法错误
D.lang
第5题:
有以下程序#include <stdio.h>main(){ unsigned char a; a=4^6; printf("%d,\n", a);}程序的运行结果是A.4, B.2,C.2 D.4
第6题:
以下程序(程序左边的数字为符加的行号)。 1#include<str.h> 2#include<stdio.h> 3main() 4{ char s[]="string"; 5puts(s); 6strcpy(s,"hello"); 7printf("%3s\n",s);}
A.没有错
B.第1行有错
C.第6行有错
D.第7行有错
第7题:
以下程序的功能是进行位运算:#include <stdio.h>main( ) unsigned char a,b; a =7∧3; b = ~4&3; printf("% d %d \n" ,a,b);}程序运行后的输出结果是( )。
A.4 3
B.7 3
C.7 0
D.4 0
第8题:
有以下程序:#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
第9题:
有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t){ char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);}main( ){ char str[10] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
第10题:
以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz"; strcpy(ar+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是______。
A.xyzabcABC
B.zabeABC
C.yzabcABC
D.xyabcABC
第11题:
有以下程序: #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
第12题:
以下程序的输出结果是【 】。
include <stdio.h>
include <string.h>
char *fun(char *t)
{ char *p=t;
return (p+strlen(t)/2);
}
main()
{ char *str="abcdefgh";
str=ftm(str);
puts(str);
}
第13题:
有以下程序 #include <stdio.h> int fun(char s[]) { int n=O; while(*s<='9'&&*s>='0') { n=10*n+*s-'0'; s++; } return (n); } main() { char s[10]={ '6', '1', '*', '4', '*', '9', '*', '0', '*'}; printf("%d\n",fun(s)); }
A.9
B.61490
C.61
D.5
第14题:
下列程序段的输出结果为( )。
#include<stdio.h>
main()
{ static char a[]="language";
char*p;
p=a;
for(p=a;p<a+8;p+=2)
putchar(*p);
}
A.language
B.lnug
C.有语法错误
D.lang
第15题:
有以下程序:#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
第16题:
有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。
A.15
B.16
C.12
D.59
第17题:
以下程序的输出结果是【 】。
include<stdio.h>
main()
{ struct stru
{ int a;
float b;
char d[4];
};
printf("%d\n",sizeof(struct stru));
}
第18题:
有以下程序 #include <stdio.h> main() { char a=4; printf("%d/n,a=a<<1); } 程序的运行结果是______。
A.40
B.16
C.8
D.4
第19题:
以下4个程序中,完全正确的是( )。
A.#include <stdio.h> main(); {/* programming */ printf("programming!\n");}
B.#include <stdio.h> main() {/*/ programming /*/ printf("programming!\n");}
C.#include <stdio.h> main() {/*/* programming */*/ printf("programming!\n");}
D.#include <stdio.h> main() {/* programming */ printf("programming!\n");}
第20题:
有以下程序: main() {unsigned char a=2,b=4,c=5,d; d=a|b;d&=c;printf(“%d\n",D);} 程序运行后的输出结果是( )。
A.3
B.4
C.5
D.6
第21题:
有以下程序: #include <stdio.h> char fun(char x,char y) { if(x<y) return x; return y; } main() { int a='9',b='8',c='7'; printf("%c\n",fun(fun(a,b),fun(b,c))); } 程序的执行结果是( )。
A.函数调用出错
B.8
C.9
D.7
第22题:
有以下程序: #include <stdio.h> main() { unsigned char a,b; a=413; b=4&3; printf("%d%d\n",a,b); } 执行后的输出结果是( )。
A.7 0
B.0 7
C.1 1
D.43 0
第23题:
有以下程序: #include <stdio.h> #include <string.h> main() { char str[][20]={"Hello","Beijing"},*P=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是( )。
A.0
B.5
C.7
D.20
第24题:
4
3
5
6