C Program For QUICK Sort In Ascending Order


void quicksort(int [10],int,int);

int main()
//Ghanendra Yadav
  int x[20],size,i;

  printf("Enter size of the array: ");

  printf("Enter %d elements: ",size);
  for(i=0;i    scanf("%d",&x[i]);


  printf("Sorted elements: ");
  for(i=0;i    printf(" %d",x[i]);

  return 0;

void quicksort(int x[10],int first,int last)
    int pivot,j,temp,i;

     if(first         pivot=first;

         while(i             while(x[i]<=x[pivot]&&i                 i++;
             if(i                 temp=x[i];




Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

1 comment: