What is the output of the program?

What is the output of the program?
#include #include using namespace std;
class First
{ string name; public:
First() { name = “Alan”;
} void Print(){ cout << name; } }; int main() { First ob1,*ob2; ob2 = new First(); ob1.Print(); ob2?>Print();
}
A. Garbage value
B. It prints: AlanAlan
C. It prints: Alan
D. It prints: Al

Download Printable PDF. VALID exam to help you PASS.

Posted in: CPA

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.