Language: C

#include<stdio.h>
#define MAX 250

int heapsize;
int HEAP[MAX];
int p(int heap){
	return heap/2;
}
int l(int heap){
	return heap*2;
}
int r(int heap){
	return (heap*2+1);
}

main(){
	int i,left,right;
	scanf("%d",&heapsize);
	
	for(i = 1;i <= heapsize;i++){
		scanf("%d",&HEAP[i]);
	}
	buildMaxHeap(HEAP);
	for(i = 0;i < heapsize;i++)
	printf("%d ",HEAP[i]);
	return 0;
}

void maxHeapify(A,i){
	int largest;
	int left = l(i);
	int right = r(i);
	if(left <= heapsize && A[i]< A[left]){
		largest = left;
	}else{
		largest = i;
	}
	if(right <= heapsize && A[right] > A[largest]){
		largest = r;
	}
	if(largest != i){
		int tmp;
		tmp = A[i];
		A[i] = A[largest];
		A[largest] = tmp;
	maxHeapify(A,largest);
	}
}
void buildMaxHeap(A){
	int i;
	for(i = (heapsize/2); i > 1;i--){
		maxHeap(A,i);
	}

Compiler output:
main.c:16:1: error: return type defaults to 'int' [-Wimplicit-int]
   16 | main(){
      | ^~~~
main.c: In function 'main':
main.c:23:9: error: implicit declaration of function 'buildMaxHeap' [-Wimplicit-function-declaration]
   23 |         buildMaxHeap(HEAP);
      |         ^~~~~~~~~~~~
main.c: In function 'maxHeapify':
main.c:29:6: error: type of 'A' defaults to 'int' [-Wimplicit-int]
   29 | void maxHeapify(A,i){
      |      ^~~~~~~~~~
main.c:29:6: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:33:33: error: subscripted value is neither array nor pointer nor vector
   33 |         if(left <= heapsize && A[i]< A[left]){
      |                                 ^
main.c:33:39: error: subscripted value is neither array nor pointer nor vector
   33 |         if(left <= heapsize && A[i]< A[left]){
      |                                       ^
main.c:38:34: error: subscripted value is neither array nor pointer nor vector
   38 |         if(right <= heapsize && A[right] > A[largest]){
      |                                  ^
main.c:38:45: error: subscripted value is neither array nor pointer nor vector
   38 |         if(right <= heapsize && A[right] > A[largest]){
      |                                             ^
main.c:39:25: error: assignment to 'int' from 'int (*)(int)' makes integer from pointer without a cast [-Wint-conversion]
   39 |                 largest = r;
      |                         ^
main.c:43:24: error: subscripted value is neither array nor pointer nor vector
   43 |                 tmp = A[i];
      |                        ^
main.c:44:18: error: subscripted value is neither array nor pointer nor vector
   44 |                 A[i] = A[largest];
      |                  ^
main.c:44:25: error: subscripted value is neither array nor pointer nor vector
   44 |                 A[i] = A[largest];
      |                         ^
main.c:45:18: error: subscripted value is neither array nor pointer nor vector
   45 |                 A[largest] = tmp;
      |                  ^
main.c: At top level:
main.c:49:6: warning: conflicting types for 'buildMaxHeap'; have 'void()'
   49 | void buildMaxHeap(A){
      |      ^~~~~~~~~~~~
main.c:23:9: note: previous implicit declaration of 'buildMaxHeap' with type 'void()'
   23 |         buildMaxHeap(HEAP);
      |         ^~~~~~~~~~~~
main.c: In function 'buildMaxHeap':
main.c:49:6: error: type of 'A' defaults to 'int' [-Wimplicit-int]
   49 | void buildMaxHeap(A){
      |      ^~~~~~~~~~~~
main.c:52:17: error: implicit declaration of function 'maxHeap'; did you mean 'maxHeapify'? [-Wimplicit-function-declaration]
   52 |                 maxHeap(A,i);
      |                 ^~~~~~~
      |                 maxHeapify
main.c:53:9: error: expected declaration or statement at end of input
   53 |         }
      |         ^