判断下面的函数定义中错误的是:
A: float volume(float x=1.0,float y=1.0,float z=1.0){return x*y*z;}
B: float volume(float x,float y=1.0,float z) {return x*y*z;}
C: float volume(float x,float y=1.0,float z=1.0) {return x*y*z;}
D: float volume(float x,float y,float z) {return x*y*z;}
A: float volume(float x=1.0,float y=1.0,float z=1.0){return x*y*z;}
B: float volume(float x,float y=1.0,float z) {return x*y*z;}
C: float volume(float x,float y=1.0,float z=1.0) {return x*y*z;}
D: float volume(float x,float y,float z) {return x*y*z;}
举一反三
- 【单选题】判断下面的函数定义中错误的是: (2.0分) A. float volume(float x=1.0,float y=1.0,float z=1.0){return x*y*z;} B. float volume(float x,float y=1.0,float z) {return x*y*z;} C. float volume(float x,float y=1.0,float z
- int max(float x , float y) { float z; z=x>y?x:y; return(z); } int main(){ float a=1.5,b=2.5,c; c=max(a,b); printf("max=%f\n",c); }
- 下面函数定义正确的是_____。 A: float fun(float x; float y){ return x*y;} B: float fun(float x, y){ return x*y;} C: float fun(x,y){ int x,y; return x*y;} D: float fun( int x, int y){ return x*y; }
- #include void main() { int max(flaot x, float y); float a, b; int c; scanf(“%f,%f”, &a, &b); c=max(a, b); printf(“Max is %d”, c);} int max(float x, float y) { float z; z = x > y ? x : y; return z;} 函数max的返回值是什么数据类型( )
- 以下程序的功能是计算下面函数的值。请填空。 # include # include float f( float,float,float); int main( ) { float x,y,z,sum; printf("\ninput x,y,z:\n"); scanf("%f%f%f",&x,&y,&z); sum=( ); printf("sum= %f\n",sum); return(0); } float f(float a,float b,float c) { float value; value=( ); return(value); }2f4cdb578a913e638a60b2fa2096c3a4.png