下面程序的运行结果是typedef union student{ char name[10]; long sno; char sex; float score[4];}STU;main(){ STU a[5]; printf("%d\n",sizeof(a));}
第1题:
C语言中各种基本数据类型的存储空间长度排列为( )
A.char≤long≤int≤float≤double
B.double≤float≤long≤int≤char
C.char≤int≤long≤float≤double
D.float≤int≤long≤char≤double
第2题:
Java语言中数据类型之间的自动类型转换是由优先关系从低级数据类型转换成高级数据类型,下面选项中自动类型转换优先级由低到高排列正确的是
A.char→long→int→double→float
B.char→int→long→double→float
C.char→int→long→float→double
D.char→int→float→double→long
第3题:
有下列程序: #include <stdio.h> #include "string.h" typedef struct{char name[9]; char sex;float score[2];}STU; void 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]; } main() { STU c={"Qian",'f',95.0,92.0}; f(C) ; printf("%s,%c,%2.0f,%2.0f\n",c.name,c.sex,c.score[0],c.score[1]); } 程序的运行结果是( )。
A.Qian,f,95,92
B.Qian,m,85,90
C.Zhao,f,95,92
D.Zhao,m, 85,90
第4题:
以下程序的结果是( )。 #include<iostream.h> void main() {char*p="abcdefgh",*r; long*q; q=(1ong*)P; q++; r=(char*)q; cout<<r<<endl;=
A.defg
B.cdef
C.ghab
D.efgh
第5题:
自动类型转换是按优先关系从低级数据转换成高级数据,规定的优先次序是( )。
A.byte,short,char→int→long→float→double
B.float→int→long→byte,short,char→double
C.int→long→float→double←byte,short,char
D.double→int→folat→long→byte,short,char
第6题:
自动类型转换是按优先关系从低级数据转换成高级数据,规定的优先次序是( )。
A.byte, short, char→int→long→float→double
B.float→int→long→byte, short, char→double
C.int→long→float→double→byte, short, char
D.double→int→float→long→byte, short, char
第7题:
自动类型转换规定的优先次序是( )。
A.short,byte,char→long→int→float→double
B.short,byte,char→int→long―float→double
C.byte,short,char→long→int→float→double
D.byte,short,char→int→long→float→double
第8题:
以下程序的输出结果是【 】。
include<iostream. h>
void main() {
char *p= "12345678" , *r;
long *q;
q=(long *)p;
q++;
r= (char *) q:
cout<<r;
}
第9题:
以下程序的结果是 #include<iostream.h> void main( ) { char * p="abcdefgh",* r; long * q; q=(long * )p; q++; r=(char * )q; cout < < r < < end1;}
A.defg
B.cdef
C.ghab
D.efgh
第10题:
A.byte, short, int, long, float, double
B.boolean, byte, short, char, int, long, float, double
C.byte, short, char, int, long, float, double
D.byte, short, char
E.int, long, float, double