当前位置:IT认证>计算机二级

问题:

[单选] 有以下程序:
#include<stdio.h>
main(  )
{int a=2,b=2,c=2;
print{("%d",a/b&c);
}
程序运行后的输出结果是(  )。

A . 0
B . 1
C . 2
D . 3

有以下程序 #include<stdio.h>main(  ){int n=2,k=0;  while(k++&&n++>2);  printf("%d%d",k,n); }程序运行后的输出结果是(  )。 O2   。 13。 57   。 12。 设x=011050,则x=x&01252的值是(  )。 0000001000101000   。 1111110100011001。 0000001011100010。 1100000000101000。 若有下的定义:"int t[3][2];",能正确表示t数组元素地址的表达式是(  )。 &t[3][2]   。 t[3]   。 t[l]。 t[2][2]。 有以下程序: #include<stdi0.h>  #include<string.h>struct A{int a;char b[10];double C;); void f(struct A t); main(  ){struct A a={"1001,"ZhangDa",l098,0};  f(a);printf("%d,%S,%6.1f",a.a,a.b,a.c);}void f(struct A t){t.a=1002;strcpy(t.b,"ChangRon9");t.c=1202.0;}程序运行后的输出结果是(  )。 1001,ZhangDa,1098.0   。 1002,ChangRong,1202.0。 1001,ChangRong,1098.0。 1002,ZhangDa,1202.0。 设有定义: struet complex{int real,unreal;)datal={1,8},data2; 则以下赋值语句中错误的是(  )。 data2=datal;   。 data2={2,6};。 data2.real=datal.real;。 data2.real=datal.unreal; 。 有以下程序:
#include<stdio.h>
main(  )
{int a=2,b=2,c=2;
print{("%d",a/b&c);
}
程序运行后的输出结果是(  )。
参考答案:

  参考解析

根据C语言运算符的优先级与结合性,先计算a/b,结果为l,再将a/b的结果与C做按位与运算,即l与2做按位与运算,其结果为0。 

在线 客服