// Pantea Aria // functions, arrays // Write a function called has_zero that: // Takes an array of integers and its size as input (what is the prototype of this function?) // Returns the number of 0 in the array // function prototype int has_zero(int array[], int length); #include int main(void) { int array[] = {2, 0, 5, -3, 0 , 0, 4}; // int result = has_zero(array, 7); printf ("the number of zeros is %d\n", has_zero(array, 7)); return 0; } // function body/definition int has_zero(int array[], int length) { int i = 0; int number_of_zeros = 0; while (i < length) { if (array[i] == 0) { number_of_zeros = number_of_zeros + 1; } i++; } return number_of_zeros; }