36.現(xiàn)有如下程序段
#include ″stdio.h″
int fun(int k,int * m)
{ 〖ZK(〗if(k%3)*m=k*k;
else * m=k/3;}〖ZK)〗
main()
{ 〖ZK(〗int(*p)(int,int * ),m;
p=fun;
(*p)(78,&m)
printf(″%d\n″,m);}〖ZK)〗
則程序段的輸出結(jié)果為( )
A.24 B.25 C.26 D.27
【參考答案】C
37.閱讀程序段,則執(zhí)行后的輸出結(jié)果為( )
#include ″stdio.h″
typedef union{ long x[2];
int y[4];
char z[8];
} atx;
typedef struct aa { long x[2];
int y[4];
char z[8];
} stx;
main()
{ printf(″union=%d,struct aa=%d\n″,sizeof(atx),sizeof(stx));}
A.union=8,struct aa=8 B.union=8,struct aa=24
C.union=24,struct aa=8 D.union=24,struct aa=24
【參考答案】B
相關(guān)推薦:
2009年9月計(jì)算機(jī)等級(jí)考試二級(jí)C語言模擬試題(1) 2009年9月計(jì)算機(jī)等級(jí)考試二級(jí)C語言模擬試題(2)