Arrays-Binary Search Testcase 2 incorrect

Sir/ Ma’am
My TestCase 2 is not giving correct answer please suggest some corrections .
Code : https://ide.codingblocks.com/s/74102

Hi Abhinav

Your code doesn’t work for the values
-34 -24 -14 -9 -8 and the element to be found is -9. Here the output should be 3 whereas your code gives -1.

Hi @ranaabhinav50
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.