runtime error in c

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];
            }
        }

give ur submission id or upload the code properly so that anyone will help u.as ur uploaded code is not understadabe.

1 Like

Write the code in proper way We cannot understand you code.Write it & then upload it in a proper manner

now as ur code is edited …and i think u r trying to solve TSORT .in that problem u have to sort upto 10^6 numbers so the array size should be at least 10^6 u r taking only 10^4.apart from that there can be testcases upto 10^6 so u have to take a test case variable on the first line of ur code .i suggest u to take a look at the already submitted solutions

//