有以下程序#include<stdio.h>int fun(){static int x=l:X*=2:return X:}main(){int i,s=l:for(i=l;i<=3,i++) s*=fun();printf(“%d\n”,s);}程序运行后的输出结果是
A.0
B.10
C.30
D.64
A.0
B.10
C.30
D.64
A.6
B.8
C.12
D.10
有以下程序#include <stdio.h>main() { int x=1, y=2, z=3; if(x>y) if(y<z) printf("%d", ++z); else printf("%d", ++y); printf("%d\n", x++);}程序的运行结果是A.331 B.41 C.2 D.1
A.741
B.963
C.852
D.875421
(21 )有以下程序
# include (stdio.h >
main ()
{ int a = l ; b = 2 ;
for (; a < 8 ; a++ ) { b+=a ; a+=2 ; }
printf (" %d , %d \ n ", a , b ) ;
}
程序运行后的输出结果是
A ) 9 , 18
B ) 8 , 11
C ) 7 , 11
D ) 10 , 14
有以下程序: #include<stdio.h> void fun(char *a,char*B){while(*a=='*')a++; while(*b=*A){b++;a++;} } main() {char*s="****a*b****",t[80]; fun(s,t);puts(t); } 程序的运行结果是()。
A.*****a*b
B.a*b
C.a*b****
D.ab
(25)有以下程序(说明:字母A的ASCII码值是65)
#include <stdio.h>
void fun(char *s)
{ while(*s)
{ if(*s%2) printf("%c",*s);
s++;
}
}
main()
{ char a[]="BYTE";
fun(a); printf("\n");
}
程序运行后的输出结果是
A)BY
B)BT
C)YT
D) YE
A.0
B.1
C.2
D.3
38) 有以下程序:
#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\n " ,ss,aa);
}
程序运行结果是
A)accxyy,bbxxyy
B)acc, bbxxyy
C)accxxyy,bbxxyy
D) accbbxxyy,bbxxyy
有以下程序
#include<stdio.h>
void fun(int *s)
{ static int j=0;
do { s[j]=s[j]+s[j+1]; )while(j<2);
}
main()
{ int k,a[10]={1,2,3,4,5);
for(k=1;k<3;k++)fun(a);
for(k=0;k<5;k++)printf(”%d”,a[k]);
printf("\n");
}
程序运行后的输出结果是
A) 12345
B)23445
C)34756
D) 35745
有以下程序
#include <stdio.h>
#include <string.h>
typedef struct{ char name[9];char sex; float score[2]; } STU;
STU f(STU a)
{ STU b={"Zhao",'m',85.0,90.0}; int i;
strcpy(a.name,b.name);
a.sex=b.sex;
for(i=0;i<2;i++) a.score[i]=b.score[i];
return a;
}
main()
{ STU c={"Qian",'f',95.0,92.0},d;
d=f(c); printf("%s,%c,%2.0f,%2.0f\n",d.name,d.sex,d.score[0],d.score[1]);
}
程序的运行结果是
A)Qian,f,95,92
B)Qian,m,85,90
C)Zhao,m,85,90
D)Zhao,f,95,92
A.26
B.19
C.10
D.20