#include <stdio.h>
void array(int arr[], int length);
int main (){
int nums[] = {1,4,2,6,3,8,9,5,0,7,10};
int len = sizeof(nums) / sizeof(int);
array(nums, len);
return 0;
}
void array(int arr[], int length){
for(int i = 0; i < length / 2; i++){
int temp = arr[i];
arr[i] = arr[length - i - 1];
arr[length - i -1] = temp;
}
for(int i = 0; i < length; i++){
printf("%d ",arr[i]);
}
printf("\n");
} |
|