im confused i have to take an array of numbers and trade them....for example take a[0] and trade it with a[5],then trade a[1] with a[4] and a[2] with a[3].... i just need some help cause i really dont understand. any help will be appreciated thanx
im confused i have to take an array of numbers and trade them....for example take a[0] and trade it with a[5],then trade a[1] with a[4] and a[2] with a[3].... i just need some help cause i really dont understand. any help will be appreciated thanx
int temp, a[10];
// fill array
temp = a[0];
a[0] = a[5];
a[5] = temp;
That could get pretty long if you did the entire array like that... so you would want to substute a logical integer variable in for the array delimiter.
a[integer1]
a[integer2]
and substitute numbers as applicable while looping through array to swap values....
It all depends on what you are doing...
Blue