Language: C

int main (){
  int i,n;
  int A[N];
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  mergeSort(A,0,n);
  for(i=0;i<n;i++){
    if(i<n-1) printf("%d ",A[i]);
    else printf("%d\n",A[i]);
  }
  printf("%d\n",count);
  return 0;
}

void merge(int A[N],int left,int mid,int right){
  int L[10000],R[10000];
  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] =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;
    }
    else{ 
      A[k] = R[j];
      j = j + 1;
    }
    count++;
  }
}
void mergeSort(int A[N],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:3:9: error: 'N' undeclared (first use in this function)
    3 |   int A[N];
      |         ^
main.c:3:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   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:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:3: error: implicit declaration of function 'mergeSort' [-Wimplicit-function-declaration]
    6 |   mergeSort(A,0,n);
      |   ^~~~~~~~~
main.c:8:15: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |     if(i<n-1) printf("%d ",A[i]);
      |               ^~~~~~
main.c:8:15: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:15: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:15: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:10: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    9 |     else printf("%d\n",A[i]);
      |          ^~~~~~
main.c:9:10: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   11 |   printf("%d\n",count);
      |   ^~~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:17: error: 'count' undeclared (first use in this function)
   11 |   printf("%d\n",count);
      |                 ^~~~~
main.c: At top level:
main.c:15:18: error: 'N' undeclared here (not in a function)
   15 | void merge(int A[N],int left,int mid,int right){
      |                  ^
main.c: In function 'merge':
main.c:39:5: error: 'count' undeclared (first use in this function)
   39 |     count++;
      |     ^~~~~
main.c: At top level:
main.c:42:22: error: 'N' undeclared here (not in a function)
   42 | void mergeSort(int A[N],int left,int right){
      |                      ^
main.c:42:6: warning: conflicting types for 'mergeSort'; have 'void(<type-error>,  int,  int)'
   42 | void mergeSort(int A[N],int left,int right){
      |      ^~~~~~~~~
main.c:6:3: note: previous implicit declaration of 'mergeSort' with type 'void(<type-error>,  int,  int)'
    6 |   mergeSort(A,0,n);
      |   ^~~~~~~~~
main.c: In function 'mergeSort':
main.c:46:15: error: type of formal parameter 1 is incomplete
   46 |     mergeSort(A,left, mid);
      |               ^
main.c:47:15: error: type of formal parameter 1 is incomplete
   47 |     mergeSort(A,mid, right);
      |               ^
main.c:48:11: error: type of formal parameter 1 is incomplete
   48 |     merge(A,left, mid, right);
      |           ^