What is wrong with my code?

please help me debug my code

@akshat2806 hey,in merge sort function apne mid n/2 lia hai which is wrong ,apko l and r indrx define krne pdenge jispr merge sort kam kregi kyunki hm recursion chla rhe hai to use chote parts me todna pdega array ko which will be sone by l and r ,here is pseudo code:
void mergeSort(int arr[], int l, int r)
{

if (l < r) 

{ 

    // Same as (l+r)/2, but avoids overflow for 

    // large l and h 

    int m = l+(r-l)/2; 



    // Sort first and second halves 

    mergeSort(arr, l, m); 

    mergeSort(arr, m+1, r); 



    merge(arr, l, m, r); 

} 

} L is initialise with 0 and r with n-1

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.