在Java中,下列()是合法的声明。     A、float f=1/3;B、int i=1/3;C、float f=1.01;D、double d=999d;

在Java中,下列()是合法的声明。     

  • A、float f=1/3;
  • B、int i=1/3;
  • C、float f=1.01;
  • D、double d=999d;

相关考题:

定义int a; float f; double i; 表达式 15+i*f+ˊAˊ的值是 _______ 。 A.floatB. intC. charD. double

定义int a; float f; double i; 6.定义表达式15+i*f+ˊAˊ的值是() 。 A.floatB. intC. charD. double

在Java中,下列()是合法的声明。 A.floatf=1/3;B.inti=1/3;C.floatf=1.01;D.doubled=999d;

下列合法的声明语句是( )。A.int_abc=50;B.double int=3+5e2.5C.long do=1L;D.float 3_asd=3e-3;

下列关于数组定义语句不正确的A.int[]a1,a2;B.int a[]={1,2,3,4,5};C.double[] d=new double[8];D.float f[]=new {2.0f,3.5f,5.6f,7.8f};

阅读以下说明和C语言函数,将应填入(n)处的字句写在对应栏内。[说明]编写一个函数,输入为偶数时,调用函数求1/2+?/+…+1/n,当输入n为奇数时,调用函数1/1+1/3+…+1/n (利用指针函数)。[函数]include "stdio. h",main(){float peven (),podd (),dcall ();float sum;int n;while (1){scanf("%d",n);if (n>1)break;}if(n%2==0){printf("Even="):(1);}else{pfinff("Odd=");(2);}printf("%f",sum);}float peven (int n){float s;int is=1;for(i=2;i<=n;i+=2)(3);return (s);}float podd (n)int n;{float s;int i;s=0;for(i=1 i<=n;i+=2)(4);return (s);}float dcall(fp,n)float (*fp) ();int n;{float s;(5);returu (s);}

下面关于数组定义语句不正确的是( )。A.int[] a1,a2;B.int a0[]={1,2,3,4,5};C.double[] d=new double[8];D.float f[] =new {2.Of,3.5f,5.6f,7.8f};

下面的说法中正确的是( )。 Ⅰ:有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.Ⅳ

下面关于数组定义语句不正确的是______。A.inta[]= {1,2,3,4};B.int[] a1, a2;C.double[] d = new double [8];D.float f[] = new {2.0f, 3.5f, 5.6f, 7.8f};

在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)

设有定义:char c;float f;int i;unsignedu;double d;下列各表达式的类型分别是()1.u+92.d!=f&&(i+2)3.8.2*i+c A.1.unsigned,2.int,3.doubleB.1.double,2.double,3.doubleC.1.int,2.double,3.charD.1.unsigned,2.double,3.int

有以下程序includevoid fun(float* p1,int n1,float,*p2,int n2,float* s){ int i;s=( 有以下程序 #include<stdio.h> void fun(float * p1,int n1,float,*p2,int n2,float * s) { int i; s=(float *)calloc(1,sizeof(float)); *s=0; for(i=0;i<n1;i++) *s+=*p1++; for(i=0;i<n2;i++) *s+=*p2++; } main() { float a[2]={1.1,2.2},b[3]={10.0,20.0,30.0),*s=a; fun(a,2,b,3,s); printf("%f\n",*s); } 上面程序的输出结果是( )A.60B.3.3C.63.3D.1.1

设变量a是int型,f是float型,i是double型,则表达式10+′a′+i*f值的数据类型为A.int B.float C.double D.不确定

以下正确的函数定义是______。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)

下面各项声明中合法的是( )。 Ⅰ:long l=4990; Ⅱ:int i=4L; Ⅲ:float f=1.1; Ⅳ:double d=4;A.Ⅱ、ⅢB.Ⅱ、Ⅲ、ⅣC.Ⅰ、ⅣD.Ⅲ、Ⅳ

下列合法的声明语句是( )。A.int_abc=50;B.double int=3+5e2.5;C.long do=1L;D.float 3_asd=3e-3:

有下列程序 main() { double d;float f;long l;int i; i=f=1=d=20/3; printf("%d%1d %f %f\n",i,1,f,D) ; } 程序运行后的输出结果是(小数点后只写1位)( )A.6 6 6.0 6.0B.6 6 6.7 6.7C.6 6 6.0 6.7D.6 6 6.7 6.0

设有定义:char c;float f;int i;unsignedu;double d;下列各表达式的类型分别是()1.u+92.d!=f(i+2)3.8.2*i+cA、1.unsigned,2.int,3.doubleB、1.double,2.double,3.doubleC、1.int,2.double,3.charD、1.unsigned,2.double,3.int

变量x、f、d分别为int,float,double类型的,除了f和d不能等于无穷大和NAN以外值可以任意选取,下面表达式为真的是()A、x==(int)(double)xB、x==(int)(float)xC、d==(double)(float)dD、(f+d)-f==d

假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()A、x==(int)(float)xB、d==(double)(float)dC、f==(float)(double)fD、(f+d)-f==d

若有定义 class A{int x,y; static float f(int a){…} float g(int x1,int x2){…}} 及A a1=new A( );则下列用法中非法的是( )。A、g(3,2)B、f(3)C、a1.f(4)D、a1.g(2,5)

Which two cause a compiler error?() A、 float[] = new float(3);B、 float f2[] = new float[];C、 float[] f1 = new float[3];D、 float f3[] = new float[3];E、 float f5[] = { 1.0f, 2.0f, 2.0f };F、 float f4[] = new float[] { 1.0f. 2.0f. 3.0f};

以下C语言语句中,正确的是()A、unsigned int a[2*3];B、char s[N+1];C、double f[];D、float b[4]={1,2,3,4,5};

单选题变量x、f、d分别为int,float,double类型的,除了f和d不能等于无穷大和NAN以外值可以任意选取,下面表达式为真的是()Ax==(int)(double)xBx==(int)(float)xCd==(double)(float)dD(f+d)-f==d

多选题在Java中,下列()是合法的声明。Afloat f=1/3;Bint i=1/3;Cfloat f=1.01;Ddouble d=999d;

单选题假定变量x,f和d的类型分别为int 、float和double。下面表达式的值总是为1的是()Ax==(int)(float)xBd==(double)(float)dCf==(float)(double)fD(f+d)-f==d

( 难度:中等)下面的哪些声明是合法的?( )A.long l = 499B.int i = 4LC.float f =1.1D.double d = 34.4E.String = ""