题目内容

执行以下语句后的结果为 。enum weekday{sun,mon=3,tue,wed,thu};enum weekday workday;workday=wed;printf("%d\n",workday);

A. 5
B. 3
C. 4
D. 编译时出错

查看答案
更多问题

设有定义"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);}

答案查题题库