can u fix it. my code is working for some numbers but when i type 3digit no itis not working
this is quick sort program it is working for only some digits, can u help me please #include<iostream> using namespace std; class K{ public: void swap(int *i,int *j){ int temp; temp=*i; *i=*j; *j=temp; } int partition(int a[],int low , int high){ int i=-1; int pivot=high; for(int j=low;j<high;j++){ if(a[j]<=a[pivot]){ i++; swap(&a[i],&a[j]); } } swap(&a[i+1],&a[high]); return(i+1); } void quick(int a[],int start,int end) { if(start<end){ int ip= partition(a,start,end); quick(a,start,ip-1); quick(a,ip+1,end); } } }; main(){ int n,j; cout<<"enter the range for quick sorting"; cin>>n; int a[n]; for(j=0;j<=n-1;j++){ cout<<"enter element"; cin>>a[j]; } K obj; obj.quick(a,0,n-1); cout<<"displaying sorted array"; for(j=0;j<=n-1;j++){ cout<<a[j]; } }