以下程序段的输出结果是()。 union node {int a; float b; Char C[10];}; printf(”%d”,sizeof(union node));
第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题:
以下程序的输出结果是【 】。
include<stdio.h>
main()
{ struct stru
{ int a;
float b;
char d[4];
};
printf("%d\n",sizeof(struct stru));
}
第4题:
有以下程序
#include <stdlib.h>
struct NODE{
int num;
struct NODE *next;};
main( )
{ struct NODE *p,*q,*r;
int sum=0;
p=(struct NODE *)malloc(sizeof(struct NODE));
q=(struct NODE *)malloc(sizeof(struct NODE));
r=(struct NODE *)malloc(sizeof(struct NODE));
p->num=1;q->num=2;r->num=3;
p->next=q;q->next=r;r->next=NULL;
sum+=q->next->num;sum+=p->num;
printf(“%d\n”,sum);}
执行后的输出结果是
A.3
B.4
C.5
D.6
第5题:
有如下程序段#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
第6题:
下面程序的输出结果是_______。 union un { int a[4]; long b; char c[6];} main() { union un u; printf("%d%d",sizeof(u),sizeof(uA) ); }
A.82
B.88
C.188
D.182
第7题:
以下程序的输出结果是 #include<stdio.h> main() { union un{ int i; long k; char c;}; struct byte{ int a; long b; union un c;}r; printf("%d\n",sizeof(r));}
A.10
B.13
C.7
D.8
第8题:
有以下程序
#include <stdlib.h>
gtruet NODE
{ int num; struct NODE *next; };
main()
{
struct NODE *p,*q,*r;
p=(struct NODE*)malloc(sizeof (struct NODE));
q=(struct NODE*)malloc(sizeof (struct NODE));
r=(struct NODE*)malloc(sizeef (struct NODE));
p->num=10; q->num=20; r->num=30;
p->next=q; q->next-r;
printf("%d\n",p->num+q->next->num);
}
程序运行后的输出结果是
A.10
B.20
C.30
D.50
第9题:
在以下程序段中,已知血型数据占两个字节,则输出结果是 union un { int i; double y; } struct st { char a[10]; union un b; }; printf("%",sizeof(struct st));
A.14
B.18
C.20
D.16
第10题:
若有下面的说明和定义: union un { char s[10]; long d[3]; }ua; struet std { char c[10];double d;int a; union un vb; }a;则printf("%d\n", sizeof(struct std)+sizeof(union un));输出的值为______。
A.34
B.52
C.54
D.64
第11题:
以下程序段的输出结果是()。 struct node {int a; float b; char c[10];} printf(“%d”,sizeof(struet node)) ;
第12题:
第13题:
下面程序和运行运行结果是【 】。
typedef union student
{ char name [10];
long sno;
char sex;
float score [4];
} STU;
main ( )
{ STU a[5];
prinff( "% d\n", sizeof(a) );
}
第14题:
下列程序的输出结果是( )。
#include<stdio.h>
main()
{ stmct st
{ int y,x,z;
};
union
{ long i;
int j;
char k;
}un;
printf("%d,%d\n",sizeof(stmct st),sizeof(un));
}
A.6,2
B.6,4
C.8,4
D.8,6
第15题:
有以下程序
#include<stdlib.h>
struct NODE
{ int num;stmct NODE*next;};
main()
{ struct NODE*p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)malloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=10;q->num=20;r->num=30;
p->next=q;q->next=r;
printf(“%d\n”,p->num+q->next->num);
}
程序运行后的输出结果是
A.10
B.20
C.30
D.40
第16题:
以下程序的输出结果是 typedef union{long x[2] int y[4]; char z[8]; } MYTYPE; MYTYPE them; main() { printf("%d\n",sizeof(them));}
A.32
B.16
C.8
D.24
第17题:
下面程序的运行结果是typedef union student{ char name[10]; long sno; char sex; float score[4];}STU;main(){ STU a[5]; printf("%d\n",sizeof(a));}
第18题:
有以下程序:
#include <stdlib.h>
struct NODE
{ int num; struct NODE *next; };
main()
{ struct NODE *p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)mallloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=10;q->num=20; r->num=30;
p->next=q;q->next=r;
printf("%d\n",p->num+q->next->num);
}
程序运行后的输出结果是( )。
A.10
B.20
C.30
D.40
第19题:
下列程序的执行结果是______。 #include<stdio.h> union { int i; char c[2]; }; void main() { union un x; x.c[0]=10; x.c[1]=1; printf("\n%d",x.i); }
A.266
B.11
C.265
D.138
第20题:
以下程序的输出结果是( ) # include<stdio.h> main() { union un{int i; long k; char c; }; struct byte{ int a; long b; union un c; } r; printf("%d\n",sizeof(r)); }
A.10
B.13
C.7
D.8
第21题:
下列程序的执行结果是______。 #include <stdio.h> union un { int i; char c[2]; }; void main() { union un x; x.c[0]=10; x.c[1]=1; printf("\n%d",x.i) }
A.266
B.11
C.265
D.138
第22题:
第23题: