Code executes

What is the output of the following code? (2, 3, 6)

int *myPtr = new int;

int *yourPtr;

*myPtr = 15;

yourPtr = new int;

delete myPtr;

myPtr = yourPtr;

*yourPtr = 28;

myPtr = new int;

*myPtr = 49;

*yourPtr = 34;

delete yourPtr;

yourPtr = myPtr;

myPtr = new int;

*myPtr = 54;

cout < *myptr=””>< “=”” “=””>< *yourptr=””><>

What is stored in numList after the following code executes? (8)

int numList[6] = 25, 37, 62, 78, 92, 13;

int *listPtr = numList;

int *temp = listPtr + 2;

int num;

*listPtr = *(listPtr + 1) – *listPtr;

listPtr++; num = *temp; temp++;

listPtr++;

*listPtr = *temp;

*temp = num;

listPtr = listPtr + 2;

*listPtr = *(listPtr – 1);

WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X