← Back to Functions/Methods
Question 123
Function: Swap with Pointers
Function: Swap with Pointers
Complete the function swap so it exchanges the values of two integers using POINTERS. Because C passes arguments by value, the function must take int pointers and modify what they point to. The main function reads two integers, calls swap, and prints them in swapped order. Example: input '3 7' prints '7 3'.
Expected Output:
7 3= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
Functions/Methods
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.