Complete the function in the editor. It has one parameter: an array, . It must iterate through the array performing one of the following actions on each element:
#include <stdio.h>
void processArray(int arr[], int size) {
for (int i = 0; i < size; i++) {
if (arr[i] % 2 == 0) {
arr[i] *= 2;
} else {
arr[i] /= 2;
}
}
}
int main() {
// Example usage:
int myArray[] = {1, 2, 3, 4, 5};
int size = sizeof(myArray) / sizeof(myArray[0]);
processArray(myArray, size);
// Print the modified array
for (int i = 0; i < size; i++) {
printf("%d ", myArray[i]);
}
return 0;
}