Q. What is the output of the following C++ code?
Code:#include <iostream>
using namespace std;
double & getVal()
{
double v = 12.99;
double &val = v;
return val;
}
int main()
{
double v = getVal();
cout << "The value = " << v;
return 0;
}
β
Correct Answer: (B)
12.99