I need to write a recursive function to perform a binary search on an array of 30.

This is what I got so far, I think I have done everything correctly, but I can't see the error in the code.

Please help, thanks.Code:int find_array(int a[], int left, int right, int elem); int main () { int a[] = { 1, 4, 6, 8, 9, 10, 13, 16, 17, 19, 20, 21, 30, 32, 33, 35, 37, 39, 50, 70, 71, 73, 79, 81, 85, 87, 95, 96, 97, 99 }; int size = sizeof(a) / sizeof(int); int num, index; while (num != 0) { printf("Enter a positive number: "); scanf("%d", &num); if (num == 0) { ; } else { index = find_array(a, 0, size-1, num); if (index == -1) { printf("%d is not included\n", num); } else { printf("%d is at index %d\n", num, index); } } } return 0; } int find_array(int a[], int left, int right, int elem) { int middle; if (left > right) { return -1; } else { middle = left + (right-left) / 2; if (elem == a[middle]) { return middle; } else { if (elem < a[middle]) { find_array(a, 0, middle-1, elem); } else { find_array(a, middle+1, right, elem); } } } }