// Pantea Aria // pointers // Write a program that: // Declares and initializes an array of 5 integers (e.g., {10, 20, 30, 40, 50}) in main. // Passes the array and its size to a function called half_array. // Print the array before and after calling the function. #include void half_array(int *numbers, int size); int main() { int numbers[5] = {10, 20, 30, 40, 50}; printf("Original array: "); for (int i = 0; i < 5; i++) { printf("%d ", numbers[i]); } printf("\n"); // print out the address of array (the name of the array) // 1. using the name of the array printf ("The address of array is %p\n", numbers); // 2. the address of the first element in the array printf ("The address of array is %p\n", &numbers[0]); // call function half_array half_array(numbers, 5); printf("array after calling function: "); for (int i = 0; i < 5; i++) { printf("%d ", numbers[i]); } printf("\n"); return 0; } void half_array(int *numbers, int size) { int i = 0; while (i < size) { numbers[i] = numbers[i] / 2; i++; } return; } // print out the address of the array from the function too