[主观题]

6 写出下列程序在X86 上的运行结果。

struct mybitfields

{

unsigned short a : 4;

unsigned short b : 5;

unsigned short c : 7;

}test

void main(void)

{

int i;

test.a=2;

test.b=3;

test.c=0;

i=*((short *)&test);

printf("%d/n",i);

}

参考答案与解析:

相关试题

写出下列程序运行后的输出结果。

[问答题] 写出下列程序运行后的输出结果。

  • 查看答案
  • 写出下列程序的运行结果。 fun(int a, int b) { if(a>b)

    [主观题]写出下列程序的运行结果。 fun(int a, int b) { if(a>b) return (a); Else return (b); } main { int x=3,y=8,z=6,r; r=fun(fun(x,y),2*z); printf(“%d/n”,r); }

  • 查看答案
  • 7写出下列程序的运行结果。 unsigned int i=3; cout< -

    [主观题]7 写出下列程序的运行结果。unsigned int i=3;cout<

  • 查看答案
  • 8 写出下列程序所有可能的运行结果。 int a; int b; int c;

    [主观题]8 写出下列程序所有可能的运行结果。int a;int b;int c;void F1(){b=a*2;a=b;}void F2(){c=a+1;a=c;}main(){a=5;//Start F1,F2 in parallelF.1(); F2();printf("a=%d/n",a);}

  • 查看答案
  • 写出下列程序段的输出结果( )。main(){int x=5; int y=10

    [单选题]写出下列程序段的输出结果( )。main(){int x=5; int y=10;printf("%d/n",x++); printf("%d/n",++y); }A.5 B.6 C.6 D.5 10 10 11 11

  • 查看答案
  • 下列程序的运行结果为()。#includemain(){struct date

    [单选题]下列程序的运行结果为()。includemain(){struct date {int year,month,day; }today; pr下列程序的运行结果为( )。 #include<stdio.h> main() { struct date {int year,month,day; }today; printf("%d/n",sizeof(struct date)); }A.8B.6C.10D.12

  • 查看答案
  • X86次列车是()列车。

    [单选题]X86次列车是()列车。A . 五定班列B . 行包快运专列C . 临时旅客D . 管内旅客

  • 查看答案
  • 指出下面程序的运行结果:

    [试题]指出下面程序的运行结果:

  • 查看答案
  • 传统的X86架构包含()

    [多选题] 传统的X86架构包含()A . 操作系统B . 应用C . HypervisorD . 底层的硬件(CPU、内存、存储等)

  • 查看答案
  • 写出下列语句的执行结果:______、______、______、______。

    [主观题]写出下列语句的执行结果:______、______、______、______。 ?STR(141.2,6,2) ?STR(141.2,2,5) ?STR(141.2) ?STR(1221.26,5,2)

  • 查看答案
  • 6写出下列程序在X86 上的运行结果。 struct mybitfields {