Code not working returning mid element every time

code- https://ide.codingblocks.com/s/230356
returning mid every time

i updated the code but still giving wrong output

@anubhavb11 hey ,I have corrected your code lease check:


Few comparison errors were there.

What should i do if i was searching for -1 itself

@anubhavb11 hey we are returning index of finding element so if we have find -1 we will return index of -1 simply ,-1 tab return hoga when key is not present in array.

helo sir, I am new and I am trying to ask some doubt in ask doubt section of the coding block’s online course but whenever I try to ask any doubt there I can’t post and then I get a link and then it bring me to this page.

@Coolvikash hey logout krke dobara login kro ,if problem still exist contact [email protected]

ok. Thanks bhiya. Thanks a lot

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.