C Program for Sorting an Array using Selection Sort

By | August 9, 2017

Sorting an Array using Selection Sort


Write a C Program for Sorting an Array using Selection Sort.  Here’s simple C Program for Sorting an Array using Selection Sort in C Programming Language.


Selection Sort


This C program sorts a given array of integer numbers using Selection Sort technique. The algorithm divides the input list into two parts: the sublist of items already sorted, which is built up from left to right at the front (left) of the list, and the sublist of items remaining to be sorted that occupy the rest of the list.

Initially, the sorted sublist is empty and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest (or largest, depending on sorting order) element in the unsorted sublist, exchanging it with the leftmost unsorted element (putting it in sorted order), and moving the sublist boundaries one element to the right.

Time Complexity of this algorithm is O(n2).


Also Read : : C Program to implement Topological Sorting Algorithm Example

Below is the source code for C Program for Sorting an Array using Selection Sort which is successfully compiled and run on Windows System to produce desired output as shown below :


SOURCE CODE : :



OUTPUT : :



If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post…


Recommended Posts : :

Leave a Reply