Not getting desired output

#include<iostream>
using namespace std;
void insertionsort(int a[], int n)
{

  for (int i = 1; i <n; i++)
  {
      int key =a[i];
      int k=i;
      while ( k>0&&a[k-1]>key)
      {
          a[k]=a[k-1];
          k--;
      }
      a[k]=key;
  }
}
bool binarysearch(int a[],int search,int start , int end)
{
    if (start>end);
    {   
        return false;
    }
    
     int mid= (start+end)/2;
     
    
         if (a[mid]==search)
         {   return true;
         }
         else
         {
             if (search>a[mid])
             {
              return  binarysearch(a,search,mid+1,end);
             }
             else
             {
                return binarysearch(a,search,start,mid-1);
             }
             
         }

}
int main(){
    int n;
    cin>>n;
    int a[n]={0};
    for (int i = 0; i < n; i++)
    {
        cin>>a[i];
    }
   insertionsort(a,n);
      int search;
   cin>>search;
   bool ans=binarysearch(a,search,0,n-1);
   cout<<boolalpha<<ans;
    
    return 0;
}

i want to print true if present and false if doesnt

hello @sagar_aggarwal
image

remove this ;(semicolon) from the if statement

thank you aman for helping :slight_smile:

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.