Complete the code to return the first even number from the array.
int firstEven(int arr[], int size) {
for (int i = 0; i < size; i++) {
if (arr[i] % 2 == 0) {
return [1];
}
}
return -1;
}Complete the code to return true if any number in the array is negative.
bool hasNegative(int arr[], int size) {
for (int i = 0; i < size; i++) {
if (arr[i] < 0) {
return [1];
}
}
return false;
}Fix the error in the code to return the index of the first zero in the array, or -1 if none.
int findZero(int arr[], int size) {
for (int i = 0; i < size; i++) {
if (arr[i] == 0) {
return [1];
}
}
return -1;
}Fill both blanks to return the sum of positive numbers in the array, stopping early if a zero is found.
int sumPositives(int arr[], int size) {
int sum = 0;
for (int i = 0; i < size; i++) {
if (arr[i] == 0) {
return [1];
}
if (arr[i] > 0) {
sum [2] arr[i];
}
}
return sum;
}Complete the code to return the first character in the string that is a vowel, or '\0' if none.
char firstVowel(const char* str) {
for (int i = 0; str[i] != '\0'; i++) {
char c = str[i];
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
return [1];
}
}
return '\0';
}