What is the output of the following code?

int *p1, *p2;
p1 = new int;
p2 = new int;
*p1=11;
*p2=0;
p2=p1;
cout << *p1 <<" " << *p2 << endl;
a. 11 0
b. 0 11
c. 11 11
d. 0 0

c. 11 11

Computer Science & Information Technology

You might also like to view...

The relative lightness of a picture is its:

a. brightness b. contrast c. recolor

Computer Science & Information Technology

Which of the following comments would be the best post-condition for this swap function void swap( int& left, int&right);

a. //Postcondition: None b. //Postcondition: the values of left and right are exchanged. c. //Postcondition: left has the value of right d. //Postcondition: left and right are unchanged

Computer Science & Information Technology