Practice · 1 of 1
Swap Two Variables
CHALLENGE
Difficulty: beginner+25 XP
Implement swapThem(a, b) so that after it runs, a holds the old b and vice versa. (Yes, std::swap exists — write it by hand once so you feel the assignment semantics.)
Press Submit to check your solution.
Back to lesson: Practice: Variables Practice