Code:
void quicksort(int *a,int left,int right)
{
 int temp,l,r,pivot;
 int i;
 l=left;
 r=right;
 pivot=a[(left+right)/2];
 do
 {
  while(a[l]<pivot)
   l++;
  while(a[r]>pivot)
   r--;
  if(l<=r)
  {
    temp=a[l];
    a[l++]=a[r];
    a[r--]=temp;
  }
 }while(l<=r);
 if(left<r)
  quicksort(a,left,r);
 if(l<right)
  quicksort(a,l,right);
}
code to implement Quick Sort in a recursive way