设有说明语句:int x=1;,语句printf(“%d/n”,-x++);的输出结果是()
第1题:
若有定义 : float x=1.5; int a=1,b=3,c=2; 则正确的 switch 语句是
A)
switch(x)
{ case 1.0: printf("*\n");
case 2.0: printf("**\n");}
B)
switch((int)x);
{ case 1: printf("*\n");
case 2: printf("**\n");}
C)
switch(a+b)
{ case 1: printf("*\n");
case 2+1: printf("**\n");}
D)
switch(a+b)
{ case 1: printf("*\n");
case c: printf("**\n");}
第2题:
设有如下定义:int x=1,y=-1;则下列语句的输出结果是______。printf("%d\n",(x--&++y));
A.1
B.0
C.-1
D.2
第3题:
若有以下定义和语句
union data
{ int i; char c; float f; } x;
int y;
则以下语句正确的是
A)x=10.5;
B)x.c=101;
C)y=x;
D)printf("%d\n",x);
第4题:
设有定义:float x=123.4567;,则执行以下语句后的输出结果是[ ]。
printf("%f\n"(int)(x*100+0.5)/100.1;
第5题:
若有以下定义,则正确的swish语句是______。 float x;int a,b;
A.switch(x) {case 1.0:printf("*\n"); case 2.0:printf("**\n"); }
B.switch(x) {case 1,2:printf("*\n"); case 3:printf("**\n"); }
C.switch(a+b) {case 1:printf("\n"); case 1+2:printf("**\n"); }
D.switch(a+b); {case 1:printf("*\n"); case 2:printf("**\n"); }
第6题:
若有定义:float x=1.5;int a=1,b=3,c=2;,则正确的switch语句是
A.switch(x) {case 1.0:printf("*\n"); case 2.0:printf("**\n");}
B.switch((int)x); {case 1:printf("*\n"); case 2:printf("**\n");}
C.switch(a+B) {case 1:printf("*\n"); case 2+1:printf("**\n");}
D.switch(a+B) {case 1:printf("*\n"); case c:printf("**\n");}
第7题:
设有定义:longx=-123456L;,则以下能够正确输出变量x值的语句是
A.printf("x=%d\n",x);
B.printf("x=%1d\n",x);
C.printf("x=%8dL\n",x);
D.printf("x=%LD\n",x);
第8题:
设有定义: float x=123.4567; ,则执行以下语句后的输出结果是 【 6 】 。
printf("%f\n",(int)(x*100+0.5)/100.0);
第9题:
A. switch(x){case 1.0:printf("*\n"); case 2.0:printf("*\n"); }
B. switch(a){case 1:printf("*\n");case 2:printf("*\n"); }
C. switch(a+b) {case 1:printf("*\n"); case 1+2:printf("*\n"); }
D. switch(a+b);{case 1:printf("*\n");case 2:printf("*\n"); }
第10题:
设有如下定义 int x=10,y=3,z; 则语句 printf("%d\n",z=(x%y,x/y)); 的输出结果是( )
A.3
B.0
C.4
D.1