已知:char s[4]=〞cba〞;char *p; 执行语句列p=s;printf(〞%c/n〞,*p+1);后,其输出为()。
第1题:
有以下程序:
void funl(char*p)
{ char*q;
q=P;
while(*q!='\O')
{(*q)++;q++;}
}
main
{ char a[]={"Program"),*P;
p=&a[3];funl(p);
printf("%s\n",a);
}
程序执行后的输出结果是( )。
A.Prohsbn
B.Prphsbn
C.Progsbn
D.Program
第2题:
以下程序运行后的输出结果是( )。
include
char*ss(char*s)
{char*p,t;
P=s+1;t=*s;
while(*p){ *(P-1)=*P;P++;}
*(P-1)=t;
return s;
}
main()
{char*p,str[10]="abcdefgh";
p=ss(str);
printf("%s\n",p);
}
第3题:
有以下程序 main() { char*s[]={"BBC","CNN","NDS"},*p; p=s[1]; printf("%c,%s\n",*(p+1),p); }执行后输出结果是______。
A.C,BBC
B.N,BBC
C.C,CNN
D.N,CNN
第4题:
有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。
A.15
B.16
C.12
D.59
第5题:
下列程序的执行结果是______。 in(f(char*s) { char*p=s; while(*p!='\0')p++; return(p-s); } main() { printf("%d\n",f("goodbye!")); }
A.3
B.6
C.8
D.0
第6题:
有如下的程序: int f(char*s) { char *p=s; while(*p!='\0') p++; return(p-s); }如果在主程序中用下述语句调用上述函数,则输出结果为______。 printf("%d\n",f("best one!"));
A.3
B.6
C.8
D.9
第7题:
下面程序的输出结果是( )。 char s()="ABCD",*p; main() { for(p=s;p<s+4;p++)printf("%s\n",p); )
A.ABCD BCD CD D
B.A B C D
C.D C B A
D.ABCD ABC AB A
第8题:
当执行下.面的程序时,其输出结果为 ______。 union st { int a; char b; } main() { union st s; char* p=(char *)&s; s.a=0x3132; s.b=0x33; printf("%c",*p); }
A.1
B.2
C.3
D.不确定
第9题:
设有如下函数定义,则输出结果为_______。 char*fun(char*str) { char*p=str; while(*p) {if(*p>'d')continue; p++; } return p; } main() { printf("%s\n",fun("welcome!")); }
A.welcome
B.come!
C.w
D.程序进入死循环
第10题:
有以下程序:void swap (char *x,char *y){char t; t=*x,*x=*y;*y=t;}main(){char* s1="abc",*s2="123"; swap(s1,s2); printf("%s,%s\n",s1,s2);}程序执行后的输出结果是( )。
A.123,abc
B.abc,123
C.1bc,a23
D.321,cba
第11题:
执行下列语句后,*(p+1)的值是(). char s[3]="ab",*p; p=s;
第12题:
c
b
a
d
第13题:
下列程序的输出结果是______。# include<stdio.h>f(char 8s){ char *p=s; while(*p!='\0')p++; return(p-s);}main(){ printf("%d\n",f("ABCDEF"));}
A.3
B.6
C.8
D.0
第14题:
下面程序的输出是______。 char s[]="ABCD"; main() { char *p; for(p=s;p<s+4;p++) printf("%s\n",p); }
A.ABCD BCD CD D
B.A B C D
C.D C B A
D.ABCD ABC AB A
第15题:
有以下程序: #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]="abcdefg",*p; p=str+strlen(str) /2+1; f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是 ______。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
第16题:
有以下程序: void swap(char*x,char*y) {cbar t; t=*x; *x=*y; *y=t; } main() {char*s1="abc",*s2="123"; swap(s1,s2);printf("%s,%s\n",s1,s2); } 程序执行后的输出结果是( )。
A.123,abc
B.abc,123
C.1bc,a23
D.321,cba
第17题:
下列程序的输出结果是( )。 char*point(char*pt): main { char b[4]={a,c,s,f),*pt=b; pt=point(pt); printf("%c\n",*pt); } point(char*p) { p+=3; return p; }
A.s
B.c
C.f
D.a
第18题:
下面程序的输出是______。 fun(char *s,int p1,int p2) { char c; while(p1<p2) { c=s[p1];s[p1]=s[p2];s[p2]=c;p1++;p2--;} } main() { char a[]="ABCDEFG",k,*p; fun(a,0,2);fun(a,4,6); printf("%s\n ",a); }
A.ABCDEFG
B.DEFGABC
C.GFEDCBA
D.CBADGFE
第19题:
以下程序运行后,输出结果是( ) #include<stdio.h> ss(char *s) { char*p=s; while(*p) p++ return(p-s); } main() { char *a="abded" int i; i=ss(a) ; printf("%d\n",i); }
A.8
B.7
C.6
D.5
第20题:
以下程序运行后的输出结果是______。 ss(char*s) { char*p=s; while(*p)p++; return(p-s); } main() { char*a="abded";int i; i=ss(a); printf("%d\n",i); }
A.8
B.7
C.6
D.5
第21题:
若有如下程序: void a(char*p,char c) {while(*p) { if(*p==c)*p=c-'b'+'B';; p++; } } main() {char s[50]="abcdeeffgee",b='e'; a(s,b);printf("%s\n",s); } 则程序运行后的输出结果是( )。
A.Abcdeeffgee
B.ABCDeeFFGee
C.abcdEEffgEE
D.ABCDEEFFGEE
第22题:
A.c
B.cde
C.b
D.abcde
第23题:
下面语句正确的是()