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
Get step-by-step solutions from verified subject matter experts
