Question
1.
#include
2.
using namespace std;
3.
void func(int a, bool flag = true)
4.
{
5.
if (flag == true ) {
6.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
void func(int a, bool flag = true)
4.
{
5.
if (flag == true ) {
6.
cout
Answer: Option C
Was this answer helpful ?
In this program, we are passing the value, as it evaluates to false, it produces the output as following.
Output:
$ g++ def.cpp
$ a.out
Flag is false. a = 200
Was this answer helpful ?
Submit Solution