A.EFGHiJKLMNOPQRST
B.EFGHiJKLMNOP
C.AEiM
D.ABCD
第2题
#include<stdio.h>
main()
{char *s=(“ABC);
do
{printf(“%d”,*s%10);s++;
}while(*s);
}
注意,字母A的ASCII码值为65。程序运行后的输出结果是
A)5670 B)656667 C)567 D)ABC
第3题
#include<stdio.h>
#include<string.h>
main()
{ char *p1="abc",*p2="ABC",str[50]= "xyz";
strcpy(str+2,strcat(p1,p2));
printf("%s\n",str);}
A.xyzabcABC
B.zabcABC
C.xyabcABC
D.yzabcABC
第4题
#include<stdio.h>
#include<string.h>
main()
{ char *p1="abc",*p2="ABC",str[50]= "xyz";
strcpy(str+2,strcat(p1,p2));
printf("%s\n",str);}
A.xyzabcABC
B.zabcABC
C.xyabcABC
D.yzabcABC
第5题
#include<stdio.h>
main()
{ char*S={"abc"}:
do
{printf("%d",*s%10);++s;}
while(*s);
}
程序运行后的输出结果是
A.abc
B.789
C.7890
D.979899
第6题
A.abc
B.789
C.7890
D.979899
第7题
#include<stdio.h>
void abc(char*str)
{ int a,b;
for(a=b=0;str[a]!='\0';a++)
if(str[a]!='c')
str[b++]=str[a];
str[b]='\0';}
void main()
{ char str[]="abcdef";
abc(str);
printf("str[]=%s",str); }
A.str[]=abdef
B.str[]=abcdef
C.str[]=a
D.str[]=ab
第8题
#include<stdio.h>
void abc(char*str)
{ int a,b;
for(a=b=0;str[a]!='\0';a++)
if(str[a]!='c')
str[b++]=str[a];
str[b]='\0';}
void main()
{ char str[]="abcdef";
abc(str);
printf("str[]=%s",str); }
A.str[]=abdef
B.str[]=abcdef
C.str[]=a
D.str[]=ab
第9题
#include <stdio.h>
main()
{ FILE *fp; int i;
char ch[]="abcd",t;
fp=fopen("abc.dat","wb+");
for(i=0; i<4; i++) fwrite(&ch[i],1,1,fp);
fseek(fp,-2L,SEEK_END);
fread(&t,1,1,fp);
fclose(fp);
printf("%c\n",t);
}
程序执行后的输出结果是
A)d
B)c
C)b
D)a
第10题
#include <stdio.h>
main ()
{ FILE *fp;char str[10];
fp=fopen ( " myfile.dat " , " w " ) ;
fputs ( " abc " ,fp ) ;fclose ( fp ) ;
fpfopen ( " myfile.dat:, " a+ " ) ;
fprintf ( fp, " %d " ,28 ) ;
rewind ( fp ) ;
fscanf ( fp, " %s " ,str ) ; puts ( str ) ;
fclose ( fp ) ;
}
程序运行后的输出结果是
A ) abc
B ) 28c
C ) abc28
D )因类型不一致而出错
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!