answersLogoWhite

0


Best Answer

#include <stdio.h>

#include <conio.h>

//Sorting an array with a single FOR loop. No complex coding and testing with multiple array sizes.

int main()

{ clrscr();

int xlist[5]={5,3,4,1,2};

int i,temp;

for (i=0;i<4;)

{

if (xlist[i]<xlist[i+1])

i++;

else

{ temp=xlist[i];

xlist[i]=xlist[i+1];

xlist[i+1]=temp;

i=0;

}

}

for (i=0;i<5;i++)

{ printf("%d ",xlist[i]); }

getch();

return 0;

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program in c language that accepts 5 integers as input and sorts them in ascending order using quick sort?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is meta assembler?

Meta-assembler is a program that accepts the syntactic and semantic description of an assembly language, and generates an assembler for that language.


What is a meta assembler?

Meta-assembler is a program that accepts the syntactic and semantic description of an assembly language, and generates an assembler for that language.


8086 assembly program to sort a list of integers?

assembly language program for sorting an array using 8086 microprocessor.


What is the assembly language program for GCD of two 16 bit unsigned integers using Intel 8086?

alp for lcm of a no


How do you Write a program in 'c' language which accepts int numbers from the users print its reverse number x function which return value?

question clarity


Which microprocessor accepts the program written for 8086 without any changes?

Which microprocessor accepts the program written for 8086 without any changes?


Write an Assembly language program which implements sorting algorithm both ascending and descending order and display those numbers with certain delay say of 5sec between successive displays?

das


Write a pseudocode for a program that accepts two integers and substract 5 from the answer?

1. Accept the 2 numbers 2. Add the 2 numbers3. Compare answer with 54. If answer is greater than 5 subtract with 5 else give a error message.


A C program using dynamic memory allocation to sort n names in ascending order?

Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.


What will be the program to arrange numbers stored in array in ascending order using pointers?

sorry


Create a program which accepts a number not less than 10The program prints the reverse of the number?

ten


What are object oriented programming language's?

Languages where all types, including primitive types such as integers, are implemented as objects. Java is a pure object oriented language. C++ is not pure because integers, floating point values and pointers are primitive data types that are not implemented as objects. As a result, Java is easier to program, but C++ is more efficient.