Language: C

int main(){

  int i,n;

  scanf("%d",&n);
  H=n;
  for(i=1;i<=n;i++)scanf("%d",&T[i]);

  BuildMaxHeap(T);

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

void MaxHeapify( int* T,int i){
  int l,r,largest,tmp;

  l=2*i;
  r=2*i+1;

  if(l<=H && T[i]<T[l])largest=l;
  else largest=i;

  if(r<=H && T[largest]<T[r])largest=r;

  if(largest!=i){
    swap(T,i,largest);
    MaxHeapify(T,largest);
  }
  
  
}

void BuildMaxHeap(int* T){
  int i;
  for(i=H/2;i>=1;i--)
    MaxHeapify(T,i);
 
}

void swap(int* T,int i, int j){

  int tmp;

  tmp=T[i];
  T[i]=T[j];
  T[j]=tmp;
}

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   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:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d",&n);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:3: error: 'H' undeclared (first use in this function)
    6 |   H=n;
      |   ^
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:32: error: 'T' undeclared (first use in this function)
    7 |   for(i=1;i<=n;i++)scanf("%d",&T[i]);
      |                                ^
main.c:9:3: error: implicit declaration of function 'BuildMaxHeap' [-Wimplicit-function-declaration]
    9 |   BuildMaxHeap(T);
      |   ^~~~~~~~~~~~
main.c:11:20: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |   for(i=1;i<=n;i++)printf(" %d",T[i]);
      |                    ^~~~~~
main.c:11:20: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:20: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:20: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   12 |   printf("\n");
      |   ^~~~~~
main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'MaxHeapify':
main.c:23:9: error: 'H' undeclared (first use in this function)
   23 |   if(l<=H && T[i]<T[l])largest=l;
      |         ^
main.c:29:5: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   29 |     swap(T,i,largest);
      |     ^~~~
main.c: At top level:
main.c:36:6: warning: conflicting types for 'BuildMaxHeap'; have 'void(int *)'
   36 | void BuildMaxHeap(int* T){
      |      ^~~~~~~~~~~~
main.c:9:3: note: previous implicit declaration of 'BuildMaxHeap' with type 'void(int *)'
    9 |   BuildMaxHeap(T);
      |   ^~~~~~~~~~~~
main.c: In function 'BuildMaxHeap':
main.c:38:9: error: 'H' undeclared (first use in this function)
   38 |   for(i=H/2;i>=1;i--)
      |         ^
main.c: At top level:
main.c:43:6: warning: conflicting types for 'swap'; have 'void(int *, int,  int)'
   43 | void swap(int* T,int i, int j){
      |      ^~~~
main.c:29:5: note: previous implicit declaration of 'swap' with type 'void(int *, int,  int)'
   29 |     swap(T,i,largest);
      |     ^~~~