CJCoding With Joseph

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
Topics:
Functions/Methods
๐Ÿ“ฅ Auto-Input:
3 7\n
This input is automatically fed to your program's stdin
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.