设有定义"enum term { my,your=4,his, her=his+10};",则输出是() printf("%d,%d,%d,%d\n",my,your, his,her);
A. 0,l,2,3
B. 0,4,0,10
C. 0,4,5,15
D. 1,4,5,15
查看答案
设有如下枚举类型定义enum language {Basic=3,Assembly=6,Ada=100,COBOL,Fortran};枚举量Fortran的值为______。
A. 4
B. 7
C. 102
D. 103
下面程序的运行结果为:main( ){ union example{ struct{ int x;int y;}in;int a;int b;}e;e.a=1;e.b=2;e.in.x=e.a*e.b;e.in.y=e.a+e.b;printf("%d,%d\n",e.in.x,e.in.y);}
下面程序的运行结果为:struct tag{ char low;char high; };union word{struct tag byte;short word; }w;main( ){ w.word=0x6b7d;printf("word value:%x\n",w.word);printf("low value:%x\n",w.byte.low);printf("high value:%x\n",w.byte.high);w.byte.high=0x56;printf("word value:%x\n",w.word);}
下面程序的运行结果为:#include union p{int i;char c[2];}x;main(){x.c[0]=13;x.c[1]=0;printf("%d\n",x.i);}