Plz tell me my mistake

#include

using namespace std;

int search(int a[],int s,int e,int key)
{

int mid=(s+e)/2;
if(a[mid] == key)
return mid;
if(a[s]<=a[mid])
{
    if((key>=a[s])&&(key<=a[mid]))
    return (a,s,mid-1,key);
    else return (a,mid+1,e,key);
}
 
    if((key>=a[mid]) && (key<=a[e]))
     return (a,mid+1,e,key);
     else return (a,s,mid-1,key);

}
int main()
{

int a;
cin>>a;
int arr[a];
for(int i=0;i<a;i++)
cin>>arr[i];
cout<<"Enter Key :";
int key;
cin>>key;

cout<<"At index "<<search(arr,0,a-1,key)<<endl;

}

@Lovishbansal
Hello Lovish,
what error u are getting?
also please paste your code in coding blocks ide ,save it and then share the generated link here

@Lovishbansal
here is your working code link-https://ide.codingblocks.com/s/177831
mistakes
a) u missed s>e this case
b) u were calling (a,s,e,key) without function name actually it should search(a,s,e,key)
I hope you find this helpful

@Lovishbansal,
Hello Lovish,
let me know if u are still facing any issue in this problem

@Lovishbansal
Hello Lovish,
if ur doubt is resolved then please mark it as resolved

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.