Question: 3B. A programmer wants to write a program that will perform reversing the elements of an integer array. Write a C function, exchange(int *p,
3B. A programmer wants to write a program that will perform reversing the elements of an integer array. Write a C function, exchange(int *p, int *q), that exchanges two integer values without any additional variables, which takes two pointers p and q containing the addresses/locations of the two integer elements of an array and then it exchanges the values in those two locations. Write a C program to read an integer array with n elements, reverse the array elements using the above function exchange and display the resulting reversed array. Do not use any additional functions.
Step by Step Solution
There are 3 Steps involved in it
C program that includes the exchange function to swap two integer values using pointers and ... View full answer
Get step-by-step solutions from verified subject matter experts
