问题 单项选择题

1)#include < iostream >

2)#include < cmath >

3)using namespace std;

4)double max(double x,doubley)

5){

6)if(x>y)

7)return x;

8)else

9)return y;

10)}

11)int main()

12){

13)doublea,b,c;

14)cout <<" input two numbers:\n";

15)cin >> a >> b;

16)c=max(a,b);

17)cout <<" the squart of max imum="<< sqrt( c );

18)}

执行完第13行后,变量a的值是:()

A.0

B.1

C.变量不存在

D.随机值

答案

参考答案:D

解析:第13行定义了3个双精度浮点型的变量a、b、c,但未对其进行初始化,执行完第13行后,变量a的值是一个随机值。

问答题
判断题