Error in the program


sir i have tried solving binary search with reccursion

Your logic is wrong
if you are using recursion then you should not use loop

either do it iteratively or do it using recursion
you mixed both

i have done some change in your code

Modified Code