网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
若已定义:int x=7;float y=7.0; 以下语句中能输出正确值的是()。
A.printf("%d %d",x,y);
B.printf("%d %.3f",x,y);
C.printf("%.3f %.3f",x,y);
D.printf("%.3f %d",x,y);
参考答案和解析
a=a+b
更多 “若已定义:int x=7;float y=7.0; 以下语句中能输出正确值的是()。A.printf("%d %d",x,y);B.printf("%d %.3f",x,y);C.printf("%.3f %.3f",x,y);D.printf("%.3f %d",x,y);” 相关考题
考题
若有以下定义和语句union data{ int i; char c; float f; } x;int y;则以下语句正确的是A)x=10.5;B)x.c=101;C)y=x;D)printf("%d\n",x);
考题
设已有定义: float x; 则以下对指针变量 p 进行定义且赋初值的语句中正确的是A)float *p=1024;B)int *p=(float)x;C)float p=x;D)float *P=x;
考题
若有如下函数模板定义,则正确使用该函数模板的语句是( )。templatevoid add(type a, type b, type 和c){ c=a+b ; }
A.float x,y,z;add(x,y,z) ;B.int x,y,z;add(x,y,和z) ;C.float x,y ;int z;add(x,y,z) ;D.float x,y ;int z;add(x,y,和z) ;
考题
在C++语言中,若类C中定义了一个方法int f(int a,int b),那么方法___(33)___不能与该方法同时存在于类C中。(33)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)
考题
若各选项中所用变量已正确定义,函数 fun 中通过 return 语句返回一个函数值,以下选项中错误的程序是A)main(){ …… x=fun(2,10); …… }float fun(int a,int b){ …… }B)float fun(int a,int b){ …… }main(){ …… x=fun(i,j); …… }C)float fun(int,int);main(){ …… x=fun(2,10); …… }float fun(int a,int b) { …… }D)main(){ float fun(int i,int j);…… x=fun(i,j); …… }float fun(int a,int b){ …… }
考题
设已有定义:float x;则以下对指针变量p进行定义且赋初值的语句中正确的是( )。A.float *p=1024;B.int *p=(float x);C.float p=x;D.float *P=x;
考题
若变量 x,y 已定义为 int 类型且 x 的值为 99 , y 的值为 9, 请将输出语句 printf( 【 7 】 ,x/y);补充完整 , 使其输出的计算结果形式为 : x/y=11 。
考题
在C++语言中,若类C中定义了一个方法int f(int a,int b),那么方法(33)不能与该方法同时存在于类C中。A.int f(int x,int y)B.int f(float a,int b)C.float f(mtx,float y)D.int f(int x,float y)
考题
若各选项中所用变量已正确定义,fun()函数中通过return语句返回一个函数值,下列选项中错误的程序是( )。A.main() {……x=fun(2,10);……} float fun(int a,int b){……}B.float fun(int a,int b){……} main() {……x=fun(i,j);……}C.float fun(int,int); main() {……x=fun(2,10);……} float fun(int a,int b){……}D.main() {float fun(int I,intj); ……x=fun(i,j);……} float fun(int a,int b){……}
考题
若有定义:int a=7;float x=2.5,y=4.7;则表达式x+a%3*(int)(x+y)%2/4的值是A.2.500000B.2.750000C.3.500000D.0.000000
考题
以下函数原型说明正确的是________。
A. float add(int x, int y) ;B. int add(int x;int y) ;C. char add( x,y) ;D. int add(char x[ ] [ ]) ;
考题
在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)
考题
l设已有定义:floatx;,则以下对指针变量p进行定义且赋初值的语句中正确的是( )。A.float*p=S
l设已有定义:floatx;,则以下对指针变量p进行定义且赋初值的语句中正确的是( )。A.float*p=&x;B.int*p-(float)x;C.float p=&x;D.float*p=1024;
考题
若有定义:“int a=4,b=5;float x=3.4,y=2.1;”,则下列表达式的值为( )。 (float)(a+b)/2+(int)x%(int)y;A.5.5B.55C.5.500000D.55.00000
考题
若有定义:int a=2,b=3;float x=3.5,y=2.5;则下面表达式的值为______。(float)(a+b)/2+(int)x%(int)yA.3.5B.35C.3.5D.35
考题
若各选项中所有变量已正确定义,函数fun中通过return语句返回一个函数值,以下选项中错误的程序是______。A.mam() {…… x=fun(2,10); ……} fioat fun(int a,int b) { ……}B.float fun (int a,int b) {……} main() {…… x=fun(i,j); ……}C.float fun (int int); main() {…… x=fun(2,10); ……} float fun (int a,int b){ ……}D.main() { float fun (int i, int j); …… x=fun(i,j); ……} float fun (int a,int b){ ……}
考题
以下正确的函数定义是______。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)
考题
在C++语言中,若类C中定义了一个方法intf(int a,int b),那么方法不能与该方法同时存在于类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)
考题
下面程序输出的结果是( )。 include using namespace std; int test(int n1
下面程序输出的结果是( )。 #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.5B.7.5C.6.25D.25
考题
若下列各选项中所有变量已正确定义,函数fun通过return语句返回一个函数值,以下选项中错误的程序是( )。A.main( ) {...... x = fun(2,10);......} float fun(int a, int b){......}B.float fun( int a,int b){......} main( ) {......x = fun(i,j);......}C.float fun(int, int); main( ) {......x=fun(2,10);......} float fun(iht a, int b){......}D.main( ) { float fun(int i, int j); ...... x = fun(i,j);......} float fun(int a,int b) {......}
考题
假设定义变量如下:int x; float y;以下输入语句中()是正确的。A、scanf(“%f%f”,y,x);B、scanf(“%f%d”, y, x);C、scanf(“%f%d”,y,x);D、scanf(“%5.2f%2d”,y,x);
热门标签
最新试卷