-
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;
}
-
- Condition is true. P = 250
- 200
- Condition is false. P = 250
- True
- False
Correct Option: C
In this program, we are passing the value, as it evaluates to false, it produces the output as following.