d)char
fun(c+4,6); for(i=0;i<10;i++) printf("%d,",c[i]); printf(""); } 程序的运行结果是 a)1,2,3,4,5,6,7,8,9,0, b)0,9,8,7,6,5,1,2,3,4, c)0,9,8,7,6,5,4,3,2,1, (33)下面程序的输出结果是 #include<stdio.h> #include<string.h> main() { char *p1="abc",*p2="abc",str[50]= "xyz"; strcpy(str+2,strcat(p1,p2)); printf("%s",str);} a)xyzabcabc b)zabcabc c)xyabcabc d)yzabcabc (34)以下函数返回 a 所指数组中最小的值所在的下标值 fun(int *a, int n) { int i,j=0,p; p=j; for(i=j;i<n;i++) if(a[i]<a[p]); ________; return(p);} 在横线处应填入的是 a)i=p b)a[p]=a[i] c)p=j d)p=i (35)下列程序的运行结果为 #include<stdio.h> void abc(char*str) { int a,b; for(a=b=0;str[a]!=;a++) if(str[a]!=c) str[b++]=str[a]; str[b]=;} void main() { char str[]="abcdef"; abc(str); printf("str[]=%s",str); } a)str[]=abdef b)str[]=abcdef c)str[]=a d)str[]=ab (36)有以下程序 #include <stdio.h> #include <string.h> typedef struct{ char name[9]; char ; float score[2]; }stu; void f(stu a) { stu b={"zhao",′m′,85 0,90 0}; int i; strcpy(a.name,b.name); a.=b.; for(i=0;i<2;i++) a.score[i]=b.score[i]; } main() { stu c={"qian",′f′,95.0,92.0}; f(c); printf("%s,%c,%2.0f,%2.0f",c.name,c.,c.score[0],c.score[1]); } 程序的运行结果是 a)qian,f,95,92 b)qian,m,85,90 c)zhao,f,95,92 (37)有以下程序 #include <stdio.h> main()
d)1,2,3,4,9,8,7,6,5,0,
d)zhao,m,85,90
{ file *fp; int a[10]={1,2,3},i,n; fp=fopen("d1.dat","w"); for(i=0;i<3;i++) fprintf(fp,"%d",a[i]); fprintf(fp,""); fclose(fp); fp=fopen("d1.dat","r"); fscanf(fp,"%d",&n); fclose(fp); printf("%d",n); } 程序的运行结果是 a)12300 b)123 c)1 d)321 (38)已知 int a=1,b=3 则 a^b 的值为 a)3 b)1 c)2 d)4 (39)阅读下列程序,则运行结果为 #include "stdio.h" fun() { static int x=5; x++; return x;} main() { int i,x; for(i=0;i<3;i++) x=fun(); printf("%d",x);} a)5 b)6 c)7 d)8 (40)有以下程序 #include <stdio.h> void fun(char *t,char *s) { while(*t!=0) t++; while((*t++=*s++)!=0); } main() { char ss[10]="acc",aa[10]="bbxxyy"; fun(ss,aa); printf("%s,%s",ss,aa); } 程序的运行结果是 a)accxyy,bbxxyy b)acc,bbxxyy c)accxxyy,bbxxyy
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-28349-17.html
并且
#易烊千玺献声小王子##易烊千玺#早安