网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下面被调用函数sub的函数值的类型是( ) sub(float A) {float b; b=a*a+1; return b; }
A.单精度型
B.双精度型
C.空类型
D.整型
参考答案
更多 “ 下面被调用函数sub的函数值的类型是( ) sub(float A) {float b; b=a*a+1; return b; }A.单精度型B.双精度型C.空类型D.整型 ” 相关考题
考题
若各选项中所用变量已正确定义,函数 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){ …… }
考题
若主调用函数类型为double,被调用函数定义中没有进行函数类型说明,而return语句中的表达式类型为float型,则被调函数返回值的类型是()。A.int型B.float型C.double型D.由系统当时的情况而定
考题
下面各被调用函数首部书写正确的是( )A.void sub(float x;float y);B.void sub(float x,y)C.void sub(float x,float y)D.void sub(float x,float y);
考题
阅读以下说明和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);}
考题
若有如下程序: float sub(int a,int b) { return(a*b); } main() {int i=1,j=2,k=3; printf("%4.0f\n",sub((int)sub(k+j,j),k+i)); } 则程序运行后的输出结果是( )。A.40B.32C.16D.编译出错
考题
设有如下的函数 funct(x) float x; {x*=x;printf("\n%d",x);return(x);} 则函数的类型( )A.与参数x的类型相同B.voidC.intD.无法确定
考题
对下面的程序,说法正确的是()。includeusing namespace std;void sum(float m, float
对下面的程序,说法正确的是( )。 #include<iostream> using namespace std; void sum(float m, float n) { float sum=m+n; } main() { cout<<sum(5.3,6.5)<<endl;}A.该程序是错误的,错误之处在于没有对sum()函数进行说明B.程序书写规整,无语法错误,是正确的C.该程序语法无错误,但在调用函数sum()时出错,因为sum()函数被定义为viod类型,但却被主函数调用,因而是错误的D.虽然sun()函数被定义为void类型,但调用时也不会出错,程序能够编译通过
考题
下列说法中正确的是______。A.常数Float.MAX_VALUE代表单精度浮点类型的正无穷大B.常数Float.MAX_VALUE代表单精度浮点类型的最大值C.常数Float.MAX_VALUE是包装类java.1ang.Double的常数D.常数Long.MIN_VALUE代表整型的最小值
考题
假设有函数模板定义如下,下列各选项中正确的是( )。 Template T Max(T a,T b,T
假设有函数模板定义如下,下列各选项中正确的是( )。 Template <class T> T Max(T a,T b,T c) { if(a<b) {if(b<c) return c; else return b;} else {if(a<c) return c; else return a;} }A.float x,y,z;float max;max=Max(x,y,z);B.float x;int y,z;float max;max=Max(x,y,z);C.float x;double y,z;float max;max=Max(x,y,z);D.三个选项都正确
考题
若下列各选项中所有变量已正确定义,函数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) {......}
考题
class super { public float getNum() {return 3.0f;} } public class Sub extends Super { } Which method, placed at line 6, will cause a compiler error?()A、 Public float getNum() {return 4.0f; }B、 Public void getNum (){}C、 Public void getNum (double d){}D、 Public double getNum (float d) {retrun 4.0f; }
考题
类Test1定义如下: 1.public class Test1{ 2. public float aMethod(float a,float b){ return 0;} 3. 4.} 将以下哪种方法插入行3是不合法的。()A、public float aMethod(float a, float b,float c){ return 0;}B、public float aMethod(float c,float d){ return 0;}C、public int aMethod(int a, int b){ return 0;}D、private float aMethod(int a,int b,int c){ return 0;}
考题
1. class super { 2. public float getNum() {return 3.0f;} 3. } 4. 5. public class Sub extends Super { 6. 7. } Which method, placed at line 6, will cause a compiler error?() A、 Public float getNum() {return 4.0f; }B、 Public void getNum () { }C、 Public void getNum (double d) { }D、 Public double getNum (float d) {retrun 4.0f; }
考题
单选题类Test1定义如下: 1.public class Test1{ 2. public float aMethod(float a,float b){ return 0;} 3. 4.} 将以下哪种方法插入行3是不合法的。()A
public float aMethod(float a, float b,float c){ return 0;}B
public float aMethod(float c,float d){ return 0;}C
public int aMethod(int a, int b){ return 0;}D
private float aMethod(int a,int b,int c){ return 0;}
考题
单选题1. class super { 2. public float getNum() {return 3.0f;} 3. } 4. 5. public class Sub extends Super { 6. 7. } Which method, placed at line 6, will cause a compiler error?()A
Public float getNum() {return 4.0f; }B
Public void getNum () { }C
Public void getNum (double d) { }D
Public double getNum (float d) {retrun 4.0f; }
考题
单选题1. class Super { 2. public float getNum() { return 3.0f; } 3. } 4. 5. public class Sub extends Super { 6. 7. } Which method, placed at line6, causes compilation to fail?()A
public void getNum(){}B
public void getNum(double d){}C
public float getNum() { return 4.0f; }D
public double getNum(float d) { return 4.0d; }
考题
单选题class super { public float getNum() {return 3.0f;} } public class Sub extends Super { } Which method, placed at line 6, will cause a compiler error?()A
Public float getNum() {return 4.0f; }B
Public void getNum (){}C
Public void getNum (double d){}D
Public double getNum (float d) {retrun 4.0f; }
热门标签
最新试卷