CAPE Computer Science Unit 1 · 2013 · Paper 2 · Question 5(b)
Write a function swap that accepts an integer array and two valid integers pos1 and pos2 representing locations in the array, and swaps the contents of these two locations.
The mark scheme is shown once you've answered.
Practise this question