网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
根据switch使用的注意事项:已知int a;float b;float c;char d;输入值,switch后面括号里的表达式可以是()。
- A、a
- B、b
- C、c
- D、d
参考答案
更多 “根据switch使用的注意事项:已知int a;float b;float c;char d;输入值,switch后面括号里的表达式可以是()。A、aB、bC、cD、d” 相关考题
考题
若有定义 : 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");}
考题
已知:char a;int b;float c;double d;执行语句“c=a+b+c+d;”后,变量c的数据类型是( )。A.int B.char C.float D.double
考题
若有定义: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");}
考题
已知程序中已经定义了函数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);
考题
( 21 )已知函数 fun 的原型为int fun ( int,int,int ) ;下列重载函数原型中错误的是A ) char fun ( int,int ) ;B ) double fun ( int,int,double ) ;C ) int fun ( int,char* ) ;D ) float fun ( int, int, int ) ;
考题
● 已知有变量 data1 定义如下:union data{ int i;char ch;float f;} data1;则变量 data1 所占的内存存储空间可表示为 (57) 。(57)A. sizeof(int)B. sizeof(char)C. sizeof(float)D. sizeof(int)+sizeof(char)+sizeof(float)
考题
设int型变量a、b,float型变量x、y,char型变量ch均已正确定义并赋值,正确的switch语句是_________。
A.switch(ch+1){......}B.switch(a+b){......}C.switch(x+y){......}D.switchch{......}
考题
类Test定义如下,将下列______方法插入③行处是不合法的。 ( )①public class Test{②public float Method(float a,float b){}③④}A.public float Method(float a,float b,float c){}B.public float Method(float c,float d){}C.public int Method(int a,int b){}D.private float Method(int a,int b,int c){}
考题
类testl定义如下: public class test1 { public float amethod(float a,float b){ } }A.public foat amethod(float a,float b,foat c){ }B.public float amethod(float c,float d){ }C.public int amethod(int a,int b){ }D.private float amethod(int a,int b,int c){ }
考题
类Test定义如下,将下列哪个方法插入③行处是不合法的( )?① public class Test{② public float Method(float a,float B) { }③ ______④ }A.public float Method(float a,float b,float C) { }B.public float Method(float c,float d){ }C.public int Method(int a,int B) { }private float Method(int a,int b,int C) { }D.private float Method(int a,int b,int C) { }
考题
下列重载函数中,正确的是( )。A.void fun(int a,float b);void fun(int C,float d)B.void fun(int a,float b);void fun(float a,int b)C.float fun(int a,float b);int fun(int b,float a)D.int fun(int a,int b);float fun(int a,int b)
考题
设int型变量a、b,float型变量x、y,char型变量ch均已正确定义并赋值,正确的switch语句是( )。A.switch(x+y){……}B.switch(ch+1){……}C.switch ch{……}D.switch(a+b):{……}
考题
public class MethodOver { public void setVar (int a, int b, float c) { } } Which two overload the setVar method?()A、 Private void setVar (int a, float c, int b) {}B、 Protected void setVar (int a, int b, float c) {}C、 Public int setVar (int a, float c, int b) (return a;)D、 Public int setVar (int a, int b, float c) (return a;)E、 Protected float setVar (int a, int b, float c) (return c;)
考题
下面的方法重载,正确的是()。A、int fun(int a, float b) { } float fun(int a, float b) { }B、float fun(int a, float b) { } float fun(int x, float y) { }C、float fun(float a) { } float fun(float a, float b) { }D、float fun1(int a, float b) { } float fun2(int a, float b) { }
考题
设int型变量a、b,float型变量x、y,char型变量ch均已正确定义并赋值,正确的switch语句是()。A、switch(x+y){……}B、switch(ch+1){……}C、switch ch{……}D、switch(a+b){……}
考题
单选题下列重载函数中,正确的是( )。A
void fun(int a,float b);void fun(int C,float d)B
void fun(int a,float b);void fun(float a,int b)C
float fun(int a,float b);int fun(int b,float a)D
int fun(int a,int b);float fun(int a,int b)
考题
多选题public class MethodOver { public void setVar (int a, int b, float c) { } } Which two overload the setVar method?()APrivate void setVar (int a, float c, int b) {}BProtected void setVar (int a, int b, float c) {}CPublic int setVar (int a, float c, int b) (return a;)DPublic int setVar (int a, int b, float c) (return a;)EProtected float setVar (int a, int b, float c) (return c;)
考题
单选题下面的方法重载,正确的是()。A
int fun(int a, float b) { } float fun(int a, float b) { }B
float fun(int a, float b) { } float fun(int x, float y) { }C
float fun(float a) { } float fun(float a, float b) { }D
float fun1(int a, float b) { } float fun2(int a, float b) { }
热门标签
最新试卷