Question
1.
#include
2.
using namespace std;
3.
double & WeeklyHours()
4.
{
5.
double h = 46.50;
6.
double &hours = h;
7.
return hours;
8.
}
9.
int main()
10.
{
11.
double hours = WeeklyHours();
12.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
double & WeeklyHours()
4.
{
5.
double h = 46.50;
6.
double &hours = h;
7.
return hours;
8.
}
9.
int main()
10.
{
11.
double hours = WeeklyHours();
12.
cout
Answer: Option A
Was this answer helpful ?
We are returning the value what we get as input.
Output:
$ g++ ret1.cpp
$ a.out
46.5
Was this answer helpful ?
Submit Solution