有如下程序段#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=24C.union=24,struct aa=8 D.union=24,struct aa=24
第1题:
下列程序的输出结果是( )。 #include <stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; } un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }
A.6, 2
B.6, 4
C.8, 4
D.8, 6
第2题:
下列程序的输出结果是( )。#include<stdio.h>main(){ struct st { int y, x,z; }; union { long i; int j; char k; }un; printf("%d,%d\n",sizeof(struct st),sizeof(un));}
A.6,2
B.6,4
C.8,4
D.8,6
第3题:
假定w、x、y、z、m均为int型变量,有如下程序段: w=1;x=2;y=3;z=4; m=(w<x)?w:x; m=(m<y)?m:y; m=(m<z)?m:z; 则该程序段执行后,m的值是_______.假定w、x、y、z、m均为int型变量,有如下程序段: w=1;x=2;y=3;z=4; m=(w<x)?w:x; m=(m<y)?m:y; m=(m<z)?m:z; 则该程序段执行后,m的值是_______.
A.4
B.3
C.2
D.1
第4题:
以下C程序段的输出结果是(30)。 #include<stdio.h> void prt(int*x,Int*y,int*z){ printf("%d,%d,%d\n",++*x,++*y,*(z++)); } void main(){ int a=10,b=40,c=20; Prt(&a,&b,&c); Prt(&a,&b,&c); }
A.11,42,31 12,22,41
B.11,41,20 12,42,20
C.11,21,40 11,21,41
D.11,41,20 12,42,22
第5题:
假定w、x,y、z、m均为int型变量,有如下程序段; w=1;x=2;y=3;z=4; m=(w<x)?w:x; m=(m<y)?m:y; m=(m<z)?m:z; 则该程序段执行后,m的值是( )
A.4
B.3
C.2
D.1