Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Cpp Programming Quiz 170 – What will be the output of the following program?

Question: What will be the output of the following program?

#include
void MyFunction(int a, int b = 40)
{
cout<< " a = "<< a << " b = " << b << endl; } int main() { MyFunction(20, 30); return 0; }

[A].a = 20 b = 40
[B].a = 20 b = 30
[C].a = 20 b = Garbage
[D].a = Garbage b = 40

Answer: Option B