Sort | Pass by Reference

/*
sort using call by reference
*/
#include<stdio.h>
#include<conio.h>
void sort(int*,const int);
void swap(int*,int*);

void main(){
	int a[20],n,i;
	clrscr();
	printf("Enter The No. of Elements...");
	scanf("%d",&n);
	printf("Enter %d Numbers:",n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	printf("\nBefore Sorting...");
	for(i=0;i<n;i++){
		printf("%d ",a[i]);
	}
	sort(a,n);
	printf("\nAfter Sorting...");
	for(i=0;i<n;i++){
		printf("%d ",a[i]);
	}
	getch();
}

void sort(int *a,const int n){
	int i,j;
	for(i=0;i<n;i++){
		for(j=0;j<n-1;j++){
			if(a[j]>a[j+1]){
				swap(&a[j],&a[j+1]);
			}
		}
	}
}

void swap(int *num1,int *num2){
	int temp;
	temp = *num1;
	*num1 = *num2;
	*num2 = temp;
}