can anyone tell why i am getting runtime error??
#include <stdio.h>
int main()
{
int i,m,n,j,k,list[10000],inc[10000];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&list[i]);
qsort(list,0,n-1);
for(i=0;i<n;i++)
{ inc[i]=list[i];
printf("%d\n",inc[i]);}
return 0;
}
void qsort(int arr[],int start,int end)
{
int p;
if (start<end)
{
partition(arr,start,end,&p);
qsort(arr,start,p-1);
qsort(arr,p+1,end);
}
}
void partition(int arr[],int start,int end,int *p)
{
int l,i=start,arr2[100],temp;
int j=end;
for(l=start;l<=end;l++)
{
if(arr[l]>=arr[start])
{
arr2[i]=arr[l];
i++;
}
else
{
arr2[j]=arr[l];
j–;
}
}
temp=arr2[j];
arr2[j]=arr2[start];
arr2[start]=temp;
*p=j;
for(i=start;i<=end;i++)
{
arr[i]=arr2[i];
}
}