This C++ program uses selection sort to sort an array of integers. It prompts the user to enter the number of array elements, reads the elements into an array, and calls the selection sort function. The selection sort function iterates through the array, finds the smallest remaining element, and swaps it into the current position to sort the array. After each pass, it prints the current sorted array.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
35 views2 pages
Programme For Selection Sort in Array
This C++ program uses selection sort to sort an array of integers. It prompts the user to enter the number of array elements, reads the elements into an array, and calls the selection sort function. The selection sort function iterates through the array, finds the smallest remaining element, and swaps it into the current position to sort the array. After each pass, it prints the current sorted array.