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

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

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

#include
class BixTest
{
public:
BixTest(int &x, int &y)
{
x++;
y++;
}
};
int main()
{
int a = 10, b = 20;
BixTest objBT(a, b);
cout<< a << " " << b; return 0; }

[A].10 20
[B].11 21
[C].Garbage Garbage
[D].It will result in a compile time error. 

Answer: Option B