Question: In C. Write a program that initializes integer type variables, data1 and data2 to the values 122 and 312. Declare pointers, ptr1 and ptr2; initialize

In C. Write a program that initializes integer type variables, data1 and data2 to the values 122 and 312. Declare pointers, ptr1 and ptr2; initialize ptr1 to point to data1 and ptr2 to point to data2. Swap the values of data1 and data2 values using direct access and using indirect access. Next, swap the values of the pointers, ptr1 and ptr2 and print the values indirectly accessed by the swapped pointers.

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!