What will be the output of the following C++ code? [code] #include <iostream> using namespace std; double & WeeklyHours()

What will be the output of the following C++ code?
Code:
    #include <iostream>
    using namespace std;
    double & WeeklyHours()
    {
        double h = 46.50;
        double &hours = h;
        return hours;
    }
    int main()
    {
        double hours = WeeklyHours();
        cout << "Weekly Hours: " << hours;
        return 0;
    }
A. 46.5
B. 6.50
C. compile time error
D. 26.5
 

Tìm kiếm

Back
Top