Question: Write a C++ program that declares int variables x, y, z and int* pointer variables p, q, r. Set x, y, z to three different

Write a C++ program that declares int variables x, y, z and int* pointer variables p, q, r. Set x, y, z to three different values. Set p, q, r to the addresses of x, y, z respectively.

  1. Print with labels the values of x, y, z, p, q, r, *p, *q, *r.
  2. Print the message: Swapping values.
  3. Execute the swap code: z = x; x = y; y = z;

Step by Step Solution

3.34 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution Code and output includ... View full answer

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 Programming Questions!