+ 1
How to swap array elemen position ? I need the algorithm
3 Respostas
0
Swapping the 0th and 1th index using a 3rd Variable :
1- Store the 0th element in a temp variable like this temp = a[0]
2- Store the 1th element in 0th position like this a[0] = a [1]
3- Store the temp element in 1th position like this a[1] = temp