Question: Give the output from this code fragment: int *p1, *p2; p1 = new int; p2 = new int; *p1 = 10; *p2 = 20; cout

Give the output from this code fragment:

int *p1, *p2;

p1 = new int;

p2 = new int;

*p1 = 10;

*p2 = 20;

cout << *p1 << << *p2 << endl;

*p1 = *p2; cout << *p1 << <<

*p2 << endl;

*p1 = 30;

cout << *p1 << << *p2 << endl;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!