下列程序的输出结果是______。#include <stdio.h>main(){ union { int k; char i[2]; } *S,a; s=&a; s->i[0]=0x39; s->i[1]=0x38; printf("%x\n",s->k);}
A.3839
B.3938
C.380039
D.390038
第1题:
【单选题】有下列程序输出结果是()。 #include <stdio.h> main() {union {int k; char i[2]; }*s,a; s=&a; s->i[0]=0x39; s->i[1]=0x38; printf("%xn",s->k); }
A.3839
B.3938
C.380039
D.390038
第2题:
有以下程序: #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
第3题:
以下程序运行后,输出结果是( ) #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
第4题:
下列程序运行后,输出结果是______。 #include <stdio. h> #include <string. h> fun (char *w ,int n) { char t,*s1,*s2; s1=w; s2=w+n-1; while (s1<s2) { t=*s1++; *s1=*s2--; *s2=t; } } main () { char *p; p="1234567"; fun (p, strlen (p)); puts (p); }
A.1234567
B.7654321
C.1711717
D.7177171
第5题:
以下程序运行后,输出结果是______。#include<stdio.h>ss (char *s){ char *p=s; while(*.p)p++; return(p-s);}main(){ char *a="abded"; int i; i=ss((A); print ("%d\n",i);}
A.8
B.7
C.6
D.5
第6题:
下列程序的输出结果是______。# 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
第7题:
以下程序的输出结果是【 】。
include <stdio.h>
define N 5
int fun(int *s,int a,int n)
{ int j;
*s=a j=n;
while(a!=s[j]) j-;
return j;
main()
{ int s[N+1]; int k:
for(k=1 ;k<=N;k++) s[k]=k+1:
print f("%d\n",fun(s,4,N));
}
第8题:
有以下程序: #include<stdio.h> #include<string.h> #include 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
第9题:
下列程序的输出结果是( )。 #include<stdio.h> void fun(int*a,int*B){ int *k; k=a;a=b;b=k;} main() { int a=1,b=2,*x=&a,*y=&b; fun(x,y); printf("%d%d",a,B); }
A.2 1
B.1 2
C.编译出错
D.0 0