reverse of an array in c code example
Example: reverse array in c
// arr is the array
// a is length of array
int j = a-1;
for(int i = 0; i<j; i++){
arr[i]^=arr[j];
arr[j]^=arr[i];
arr[i]^=arr[j];
j--;
}
// arr is the array
// a is length of array
int j = a-1;
for(int i = 0; i<j; i++){
arr[i]^=arr[j];
arr[j]^=arr[i];
arr[i]^=arr[j];
j--;
}