Questions and Answers
- What is the output of this program?
#include
using namespace std;
double Time()
{
double T = 26.25;
double H = T;
return H;
}
int main()
{
double H = Time();
cout << "Weekly Hours: " << H;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
We are returning the value what we get as input.
- What is the output of this program?
#include
using namespace std;
int max(int p, int q)
{
return ( p > q ? p : q);
}
int main()
{
int m = 15;
int n = 16;
cout << max(m, n);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
In this program, we are returning the maximum value by using conditional operator.
- When will we use the function overloading?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
In function overloading, we can use any number of arguments but same function name.
- What will you use if you are not intended to get a return value?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Void is used to not to return anything.
- How many types of returning values are present in c++?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The three types of returning values are return by value, return by reference and return by address.