Not giving output

I m trying these in practicals but output is coming -1 only… Not working properly

@ssmit_joshi hey please send me your code of binary search.

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.

binary search not declared is showing

Hey @ssmit_joshi
Since u have created ur function after main ,u have to declare it before main by adding

int binary_search(int a[],int n,int key);

before int main()

If this resolves your query then please mark it as resolved :slight_smile: