Write a program that swaps the elements of an array


Write a program that swaps the elements of an array pairwise. Start from the left of the array, take 2 elements at a time and swap the two elements. Continue in this fashion until you reach the end of the array. Declare an integer array of size 10 and place random numbers in the range [0-9]. Print the original array, pairwise swap the elements of the array and print the final array after swap. Consider the following example.
0 1 2 3 4 5 6 7 8 9
1 7 4 0 9 4 8 8 2 4
After pairwise swap you get the following array
0 1 2 3 4 5 6 7 8 9

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program that swaps the elements of an array
Reference No:- TGS0661286

Expected delivery within 24 Hours