以下程序的输出结果是【 】。
include<stdio.h>
main()
{ struct stru
{ int a;
float b;
char d[4];
};
printf("%d\n",sizeof(struct stru));
}
第1题:
以下程序的输出结果是【 】。
include <stdio.h>
include <string.h>
char *fun(char *0
{ char *p--t;
return (p+strlen(t)/2);
}
main()
{ char *str="abcdefgh";
str=ftm(str);
puts(str);
}
第2题:
若有以下程序 #include <stdio.h> int a[]={2,4,6,8}; main() { int i; int *p=a; for(i=0;i<4;i++)a[i]=*p; printf("%d\n",a[2]);} 上面程序输出结果是
A.6
B.8
C.4
D.2
第3题:
以下程序的输出结果是( )。 include<stdio.h> void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main() {int i=3,j=5,*p=&i,*q=&j; swap(p,q);printf("%d %d\n",*p,*q); }
第4题:
下面程序的输出结果是_______。 #include<stdio.h> main() { char*p[]={"DOOL","OPK","H","SP"}; int i; for (i=3;i>=0;i-,i-) printf("%c",*p[i]); printf("\n"); }
A.SO
B.SP
C.SPOPK
D.SHOB
第5题:
有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是( )。
A.2
B.3
C.4
D.5
第6题:
以下程序的输出结果是【 】。
include <stdio.h>
include <string.h>
char *fun(char *t)
{ char *p=t;
return (p+strlen(t)/2);
}
main()
{ char *str="abcdefgh";
str=ftm(str);
puts(str);
}