Introduction
- Where can the default parameter be placed by the user?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
rightmost
- What will happen when we use void in argument passing?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
As void is not having any return value, it will not return the value to the caller.
- What is the output of this program?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
We have passed three values and it will manipulate according to the given condition and yield the result as 10 65
- If the user did not supply the value, what value will it take?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
If the user did not supply the value means, the compiler will take the given value in the argument list.
- What is the output of this program?
#include
using namespace std;
void function(int p, bool condition = true)
{
if (condition == true )
{
cout << "Condition is true. P = " << p;
}
else
{
cout << "Condition is false. P = " << p;
}
}
int main()
{
function(250, false);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
In this program, we are passing the value, as it evaluates to false, it produces the output as following.