单项选择题
有如下程序:
#include<iostream>
using namespace std;
int main()
void function(double val);
double val;
function(val);
cout<<val;
return 0;
void function(double val)
val= 3;
编译运行这个程序将出现的情况是( )。
A.编译出错,无法运行
B.输出:3
C.输出:3.0
D.输出一个不确定的数
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
若有以下程序: #include <iostream> using namespace std; class A public: A() A(int i) x1=i; void dispa0 cout<< x1= <<x1<< , ; private: int x1; ; class B: public A public: B() B(int i):A(i+10) x2=i; void dispb() dispa(); cout<< x2= <<x2<<endl; private: int x2; ; int main() B b(2); b.dispb(); return 0; 程序运行后的输出结果是( )。
A.x1=10,x2=2
B.x1=12,x2=10
C.x1=12,x2=2
D.x1=2,x2=2
点击查看答案
单项选择题
以下程序执行后的输出结果是( )。 #include<iostream> using namespace std; void try(int,int,int,int); int main() int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<endl; return 0; void try(int x,int y, int z,int r) z = x+y; X = x*x; y = y*y; r = z+x+y;
A.18
B.9
C.10
D.不确定
点击查看答案
相关试题
下列程序的输出结果为2,请将程序补充完整...
下列程序运行后的输出结果是 【15】 。...
阅读下面程序: #include<iostream.h>...
在MyClass类的定义中,对赋值运算符:进行...
指针变量所保存的不是一般的数据值,而是程...