I'm trying to create a QuickSort algorithm but while I did have success in writing one that doesn't give me an error, the programm crashes after entering the unsorted numbers.

I already searched but couldn't find anything, could someone help me?

Code:

void swap(int left, int right, int Numbers[]) {
int temp = Numbers[left];
Numbers[left] = Numbers[right];
Numbers[right] = temp;
return;
}
void quicksort(int Beginning, int End, int Numbers[]) {
int pivot = Numbers[((Beginning+1)+End)/2];
int left = Beginning-1;
int right = End;
do {
while (Numbers[left] < pivot) {
left++;
}
while (Numbers[right] < pivot) {
right--;
}
if (right > left) {
swap(left,right,Numbers);
left++;
right--;
}
} while (left <= right);
if (Beginning < right) {
quicksort(Beginning,right,Numbers);
}
if (End < left) {
quicksort(End,left,Numbers);
}
}
int main()
{
int End,Beginning,Dim,i;
printf("Number of Elements: ");
scanf("%d",&Dim);
int Numbers[Dim];
for ( i = 0 ; i < Dim ; i++ ) {
printf("Enter the %d. element: ",i+1);
scanf("%d",&Numbers[i]);
}
Beginning = 0;
End = Dim-1;
quicksort(Beginning,End,Numbers);
printf("\ngsorted:");
for ( i = 0 ; i < Dim ; i++ ) {
printf("[%d]: %d",i+1,Numbers[i]);
}
return 0;
}