1、【2010年计算机联考真题】假定变量i、f和d的数据类型分别为int、float和double(int用补码表示,float和double分别用IEEE 754单精度和双精度浮点数格式表示),已知i=785、f=1.5678E3、d=1.5E100,若在32位机器中执行下列关系表达式,则结果为“真”的是()。 I. i=(int)(float)i II. f=(float)(int)f III. f=(float)(double)f IV. (d+f)-d=f
A.I和II
B.I和III
C.II和III
D.III和IV
第1题:
已知程序中已经定义了函数test,其原型是int test(int,int,int);,则下列重载形式中正确的是
A.char test (int,int,int);
B.double test(int,int,double);
C.int test(int,int,int=O);
D.float test(int,int,float=3.5F);
第2题:
设变量a是int型,f是float型,i是double型,则表达式10+'a'+i*f的值的数据类型为( )。
A.int
B.float
C.double
D.不确定
第3题:
设变量a是int型,f是double型,i是float型,则表达式10+'a'+i * f值的数据类型是
A.int
B.float
C.double
D.不确定
第4题:
设变量a是int型,f是int型,i是double型,则表达式10+a+i*f值的数据类型为A.int B.float C.double D.不确定
第5题:
有如下定义 int a; float f; double i; 则表达式4+‘a’+i*f的值的数据类型是 ______。
A.int
B.float
C.double
D.不确定
第6题:
A.1.unsigned,2.int,3.double
B.1.double,2.double,3.double
C.1.int,2.double,3.char
D.1.unsigned,2.double,3.int
第7题:
以下正确的函数定义是______。
A.double f1(int x,int y)
B.double f1(int x;int y)
C.double f1(int x;float y)
D.double f1(int x,y)
第8题:
A.9
B.5
C.6
D.6.1
第9题:
float f=-123.567F;inti=(int)f.则i的值现在是()。
第10题:
变量x、f、d分别为int,float,double类型的,除了f和d不能等于无穷大和NAN以外值可以任意选取,下面表达式为真的是()
第11题:
Which of the following statements are legal?()
第12题:
x==(int)(float)x
d==(double)(float)d
f==(float)(double)f
(f+d)-f==d
第13题:
已知有变量datal定义如下: union data { int i; char ch; float f; }datal; 则变量datal所占的内存存储空间可表示为(57)。
A.sizeof(int)
B.sizeof(char)
C.sizeof(float)
D.SiZCOf(mt)+sizeof(char)+sizeof(float)
第14题:
设变量a是 int 型,f是 double 型,i是 float 型,则表达式10+'a'+i*f值的数据类型
A.int
B.float
C.double
D.不确定
第15题:
下面的说法中正确的是( )。 Ⅰ:有float型数据定义float f1=100.00f;Float F1=new float(f1),要把float型转换为double型时用Double d1=F1.doubleValue()。 Ⅱ:有double型数据定义double d1=100.00;Double D1=new Double(d1),要把double型转换为int型时用 int il=D1.intValue()。 Ⅲ:当把int型转换为double型时,该转换是不能自动转换的,需要强制类型转换。 Ⅳ:以上说法都不对。
A.Ⅱ、Ⅲ
B.Ⅰ、Ⅲ
C.Ⅰ、Ⅱ
D.Ⅳ
第16题:
设有定义nit a:float f; double int i,则表达式10+'a'+i+f值的数据类型是( )
A.int
B.float
C.double
D.不确定
第17题:
float f=-123.567F;
int i=(int)f;
i的值现在是_____?
第18题:
设变量a是int型,f是float型,i是double型,则表达式10+′a′+i*f值的数据类型为A.int B.float C.double D.不确定
第19题:
下面哪个是非法的( )。
A.int I=32;
B.float f=45.0;
C.double d=45.0;
D.char c ='a';
第20题:
A. 4
B. 5
C. 6
D. 6.1
E. 9
第21题:
在Java中,下列()是合法的声明。
第22题:
假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()
第23题:
1.unsigned,2.int,3.double
1.double,2.double,3.double
1.int,2.double,3.char
1.unsigned,2.double,3.int
第24题:
x==(int)(double)x
x==(int)(float)x
d==(double)(float)d
(f+d)-f==d