Language: C

int main(){

  int n,i,j;
  int left,right;

  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&A[i]);
  }

  left = 0;
  right = n;

  mergeSort(A,left,right);

  for(i=0; i<n-1; i++){
    printf("%d ",A[i]);
  }
  printf("%d\n",A[n-1]);

  printf("%d\n",c);

  return 0;
}

void merge(int* A,int left,int mid,int right){

  int n1,n2,i,j,k;

  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] = 10000000000;
  R[n2] = 10000000000;

  i=0;
  j=0;

  for(k = left; k < right; k++){
    if(L[i] <= R[j]){
      A[k] = L[i];
      i++;
      c++;
    }
    else{
      A[k] = R[j];
      j++;
      c++;
    }
  }

}

void mergeSort(int* A,int left,int right){

  int mid;

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

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |   scanf("%d",&n);
      |   ^~~~~
main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:17: error: 'A' undeclared (first use in this function)
    8 |     scanf("%d",&A[i]);
      |                 ^
main.c:8:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:3: error: implicit declaration of function 'mergeSort' [-Wimplicit-function-declaration]
   14 |   mergeSort(A,left,right);
      |   ^~~~~~~~~
main.c:17:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |     printf("%d ",A[i]);
      |     ^~~~~~
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   19 |   printf("%d\n",A[n-1]);
      |   ^~~~~~
main.c:19:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:21:17: error: 'c' undeclared (first use in this function)
   21 |   printf("%d\n",c);
      |                 ^
main.c: In function 'merge':
main.c:34:5: error: 'L' undeclared (first use in this function)
   34 |     L[i] = A[left+i];
      |     ^
main.c:38:5: error: 'R' undeclared (first use in this function)
   38 |     R[i] = A[mid+i];
      |     ^
main.c:50:7: error: 'c' undeclared (first use in this function)
   50 |       c++;
      |       ^
main.c: At top level:
main.c:61:6: warning: conflicting types for 'mergeSort'; have 'void(int *, int,  int)'
   61 | void mergeSort(int* A,int left,int right){
      |      ^~~~~~~~~
main.c:14:3: note: previous implicit declaration of 'mergeSort' with type 'void(int *, int,  int)'
   14 |   mergeSort(A,left,right);
      |   ^~~~~~~~~