The document contains C++ code to rearrange an array of numbers in descending order. It first prompts the user to enter the size of the array and its elements. It then uses a double for loop to compare all elements and swap any that are out of order, with the larger number appearing first in the sorted array. Finally, it prints out the rearranged array of numbers from largest to smallest.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
61 views2 pages
Arranging An Array in Descending Order
The document contains C++ code to rearrange an array of numbers in descending order. It first prompts the user to enter the size of the array and its elements. It then uses a double for loop to compare all elements and swap any that are out of order, with the larger number appearing first in the sorted array. Finally, it prints out the rearranged array of numbers from largest to smallest.