I read the question. We are calling doSomething(arr, 0, n-1, x). We do a similar when do a binary search too, but there, we define the value of n before passing it to the function. Here, we have passed an undefined value (n-1) to the function. What value will the compiler interpret as for n-1? Unless there is an implicit assumption that the value of n has already been calculated and passed to the function with the compiler knowing.
Even then, it will always exit in the first step as 0 will be less than n-1 for any array having more than one element. If a > b was the condition, then the question makes sense and B should be the answer.