- Write a function named swap that can be called to exchange the values of two integers.Test the function swap by invoking (calling) it from a main function to exchange the values of two integer variables declared in main. For a hint, see problem 4 on page 255 of your text.