下面关于float数的定义错误的是( )。
A、float f=-5;
B、float f=0x0687;
C、float f=1.0;
D、float f=7.8f;
第1题:
A.float[]=newfloat(3);
B.floatf2[]=newfloat[];
C.float[]f1=newfloat[3];
D.floatf3[]=newfloat[3];
E.floatf5[]={1.0f,2.0f,2.0f};
F.floatf4[]=newfloat[]{1.0f.2.0f.3.0f};
第2题:
有以下程序:#include <stdio.h>float f1 (float n ){ return n*n;}float f2 ( float n){ return 2 * n;}main( ){ float ( * p1)(float),( * p2)(float),(*t)(float) ,y1,y2; p1 = f1;p2 = f2; y1 = p2(p1(2.0) ); t =p1;p1 = p2;p2 =t; y2=p2(p1(2.0)); prinff("% 3.0f, %3.Of\n" ,y1,y2);}程序运行后的输出结果是( )。
A.8,16
B.8,8
C.16,16
D.4,8
第3题:
下列程序语句中,不正确的是______。
A.maia() { float a,b,c; scanf("%f,%f",&a,&b); c=add(a,b); …… } int add(float x,float y) {……}
B.main() { float a,b,c; scanf("%f,%f",&a,&b); c=add(a,b); …… } float add(float x,float y) {……}
C.float add() maia() { float a,b,c; scanf("%f,%f",&a,&b); c=add(a,b); …… } float add(float x,float y) {……}
D.float add(float x, float y) {……} main() { float a,b,c; scanf("%f,%f",&a,&b); c=add(a, b); …… }
第4题:
Which the three are valid declarations of a float?()
第5题:
关于float数定义正确的是()
第6题:
Which three are valid declarations of a float? ()
第7题:
下列语句定义pf为指向float类型变量f的指针,()是正确的。
第8题:
下面关于float数的定义错误的是()
第9题:
Which two are valid declarations of a float?()
第10题:
float f=1.0
float=x0x0687
float=-5
float=1.8f
第11题:
float[] = new float(3);
float f2[] = new float[];
float[] f1 = new float[3];
float f3[] = new float[3];
float f5[] = { 1.0f, 2.0f, 2.0f };
float f4[] = new float[] { 1.0f. 2.0f. 3.0f};
第12题:
f[0] = f0;
f[0] = farray;
f[0] = farray[0];
f[0] = farray[0][0];
第13题:
在C++语言中,若类C中定义了一个方法int (int a,int b),那么方法(1)不能与该方法同时存在于类C中。
A.int f(int x,int y)
B.int f(float a,int b)
C.float f(int x,float y)
D.int f(int x,float y)
第14题:
下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) {return n1 +n2;} float test (int f1,float f2){return f1-f2;} float test(float x,float y){return(x+y)/2;} float test(float x,int y){return(x+y)*2;} void main(){ int a1=10; float a2=2.5f; cout<<test(a1,a2); }
A.12.5
B.7.5
C.6.25
D.25
第15题:
float f[][][] = new float[3][][]; float f0 = 1.0f; float[][] farray = new float[1][1]; What is valid?()
第16题:
假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()
第17题:
下列选项中,能有效地描述浮点数的有()。
第18题:
Which two cause a compiler error?()
第19题:
float型float f=3.4是否正确。
第20题:
class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass extends BaseClass { private float x = 2.0f; //insert code here } Which two are valid examples of method overriding?()
第21题:
Void setVar(float f) {x = f;}
Public void setVar(int f) {x = f;}
Public void setVar(float f) {x = f;}
Public double setVar(float f) {x = f;}
Public final void setVar(float f) {x = f;}
Protected float setVar() {x=3.0f; return 3.0f; }
第22题:
x==(int)(float)x
d==(double)(float)d
f==(float)(double)f
(f+d)-f==d
第23题:
float f=-5;
float f=0x0687;
float f=1.0;
float f=7.8f;
第24题:
Void setVar(float f) {x = f;}
Public void setVar(int f) {x = f;}
Public void setVar(float f) {x = f;}
Public double setVar(float f) {x = f;}
Public final void setVar(float f) {x = f;}
Protected float setVar() {x=3.0f; return 3.0f; }