Hi Guys,
I hit a road block, I'm trying to swap the values of an array an example would be swapping a[0] with a[1]. I understand you could easily do with using a temp but I'm really stuck on how to do this using a for loop.
temp = a[0]
a[0] = a[1]
a[1] = temp
but when I tried to do something like this for an array I am completely clueless. This is where I got stuck. Thanks
The only thing I can think of is maybe another loop inside that but I really have no clue how that would workCode:void transpose (int a[], int size) { int i = 0; int temp; printf("Now the array is \n"); for (i = 0; i <= size -1; i++) { temp = a[i]; } printf("\n");