填空题

下列程序的执行结果是______。
#include<iostream.h>
float temp;
float&fn2(float r)
temp=r*r*3.14;
return temp;
void main( )
float a=fn2(5.0);
float&b=fn2(5.0);
b=20;
cout<<temp<<endl;

【参考答案】

T
<上一题 目录 下一题>
热门 试题

填空题
下列类的构造函数不能通过编译,正确的构造函数应该是______。 #include<iostream.h> class Sample public: int n; const int con; Sample(int m) con=m+1;n=m; void disp( ) cout<< normal:n= <<n<<endl; void disp( )const cout<< static:n= <<n<<endl; ; void main( ) const Sample a (12); Sample b (13); a.disp( ); b.isp( ); cout<<a.n<< , <<b.con<<endl;
填空题
下列程序的输出结果为______。 #include<iostream.h> void Func(char ch) switch(ch) case ’A’:case ’a’: cout<< 优秀 <<endl; case ’B’:case ’b’: cout<< 良好 <<endl; break; case ’C’:case ’c’: cout<< 及格 <<endl; break; default: cout<< 不及格 <<endl; void main( ) char ch1=’b’ Func(ch1); Func(’A’);
相关试题
  • 根据注释内容在空白处填写适当内容。 clas...
  • 下列程序的输出结果为______。 #in...
  • 下列类的构造函数不能通过编译,正确的构造...
  • 有以下程序 main( ) int i=0,s=...
  • 下列不是循环语句的是