The function should return the index of the element if the element is in the array or -1 if the element is not in the array.
int function(int a[], int length