Question
#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.
none of the mentioned
Posted under Object Oriented Programming Using C++
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. When will we use the function overloading?
View solution
Q. Which of the following permits function overloading on c++?
View solution
Q. In which of the following we cannot overload the function?
View solution
Q. Function overloading is also similar to which of the following?
View solution
Q. Overloaded functions are
View solution
Q. What will happen while using pass by reference
View solution
Q. When our function doesn’t need to return anything means what will we use/send as parameter in function?
View solution
Q. What are the advantages of passing arguments by reference?
View solution
Q. If the user didn’t supply the value, what value will it take?
View solution
Q. Where can the default parameter be placed by the user?
View solution
Q. Which value will it take when both user and default values are given?
View solution
Q. What we can’t place followed by the non-default arguments?
View solution
Q. If we start our function call with default arguments means, what will be proceeding arguments?
View solution
Q. What is the default return type of a function ?
View solution
Q. Which header file is used to pass unknown number of arguments to function?
View solution
Q. How can you access the arguments that are manipulated in the function?
View solution
Q. What is the maximum number of arguments or parameters that can be
View solution
Q. Which header file should you include if you are to develop a function that can accept variable number of arguments?
View solution
Q. What will initialize the list of arguments in stdarg.h header file?
View solution
Q. To which does the function pointer point to?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Object Oriented Programming Using C++? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!