Language: C

int i,j,m,n,count,A[500000];
  count=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  count=mergeSort(A,0,n);
  for(i = 0; i < n; i++)
    printf("%d ", A[i]);
  printf("\n");
  printf("%d\n",count);
  return 0;
}


int mergeSort(int A[],int left,int right){
  int mid,i,j,k,con=0;

  if(left+1<right){
  mid=(left+right)/2;
  mergeSort(A,left,mid);
  mergeSort(A,mid,right);
  con=merge(A,left,mid,right);
  }
  return con;
}

int merge(int *A,int left,int mid,int right){
  int i,j,k=0,L[500000],R[500000],n1,n2;
  n1=mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=A[left+i];
  }
  for(i=0;i<n2;i++){
    R[i]=A[mid+i];
  }
  L[n1]=1000000;
  R[n2]=1000000;
  i=0;
  j=0;
  for(k=left;k<right;k++){
    if(L[i]<=R[j]){
      A[k]=L[i];
      i=i+1;
      count++;
    }
    else{
      A[k]=R[j];
      j=j+1;
      count++;
    }
  }
  return count;
}

Compiler output:
main.c:2:3: warning: data definition has no type or storage class
    2 |   count=0;
      |   ^~~~~
main.c:2:3: error: type defaults to 'int' in declaration of 'count' [-Wimplicit-int]
main.c:3:9: error: expected declaration specifiers or '...' before string constant
    3 |   scanf("%d",&n);
      |         ^~~~
main.c:3:14: error: expected declaration specifiers or '...' before '&' token
    3 |   scanf("%d",&n);
      |              ^
main.c:4:3: error: expected identifier or '(' before 'for'
    4 |   for(i=0;i<n;i++){
      |   ^~~
main.c:4:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    4 |   for(i=0;i<n;i++){
      |            ^
main.c:4:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    4 |   for(i=0;i<n;i++){
      |                ^~
main.c:7:3: warning: data definition has no type or storage class
    7 |   count=mergeSort(A,0,n);
      |   ^~~~~
main.c:7:3: error: type defaults to 'int' in declaration of 'count' [-Wimplicit-int]
main.c:7:3: error: redefinition of 'count'
main.c:2:3: note: previous definition of 'count' with type 'int'
    2 |   count=0;
      |   ^~~~~
main.c:7:9: error: implicit declaration of function 'mergeSort' [-Wimplicit-function-declaration]
    7 |   count=mergeSort(A,0,n);
      |         ^~~~~~~~~
main.c:7:9: error: initializer element is not constant
main.c:8:3: error: expected identifier or '(' before 'for'
    8 |   for(i = 0; i < n; i++)
      |   ^~~
main.c:8:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    8 |   for(i = 0; i < n; i++)
      |                ^
main.c:8:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    8 |   for(i = 0; i < n; i++)
      |                      ^~
main.c:10:10: error: expected declaration specifiers or '...' before string constant
   10 |   printf("\n");
      |          ^~~~
main.c:11:10: error: expected declaration specifiers or '...' before string constant
   11 |   printf("%d\n",count);
      |          ^~~~~~
main.c:11:17: error: expected declaration specifiers or '...' before 'count'
   11 |   printf("%d\n",count);
      |                 ^~~~~
main.c:12:3: error: expected identifier or '(' before 'return'
   12 |   return 0;
      |   ^~~~~~
main.c:13:1: error: expected identifier or '(' before '}' token
   13 | }
      | ^
main.c: In function 'mergeSort':
main.c:23:7: error: implicit declaration of function 'merge' [-Wimplicit-function-declaration]
   23 |   con=merge(A,left,mid,right);
      |       ^~~~~