1.

What will be the output of the following program?

#include<iostream.h> class Bix
{ public: int x;
};
int main()
{ Bix *p = new Bix(); (*p).x = 10; cout<< (*p).x << " " << p->x << " " ; p->x = 20; cout<< (*p).x << " " << p->x ; return 0;
}

A. 10 10 20 20
B. Garbage garbage 20 20
C. 10 10 Garbage garbage
D. Garbage garbage Garbage garbage
Answer» B. Garbage garbage 20 20


Discussion

No Comment Found

Related MCQs