Regarding this question


sir can you please check and tell me the error

@sraj39273
your while loop condition inside find function should be while ( s<=e ) you have taken opposite hence your program is never going inside while loop.


sir I don’t know why its showing me wrong output for this case
8
6 7 8 1 2 3 4 5
5

if condition at line 20 should be if(key>=a[mid]&&key<=a[e]) you have taken a[mid] for both comparison with key.

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.