Computer Science, asked by AnushreeH6861, 1 year ago

Write a program to sort the numbers stored in an array in ascending order.The sorted numbers should be stored in same array and only one array should be created in the program.In c++

Answers

Answered by AfreenMohammedi
1

Answer:

1. Create an array of fixed size (maximum capacity), lets say 10.

2. Take n, a variable which stores the number of elements of the array, less than maximum capacity of array.

3. Iterate via for loop to take array elements as input, and print them.

4. The array elements are in unsorted fashion, to sort them, make a nested loop.

5. In the nested loop, the each element will be compared to all the elements below it.

6. In case the element is greater than the element present below it, then they are interchanged

7. After executing the nested loop, we will obtain an array in ascending order arranged elements.

Answered by MysticalKudi
0

\huge {\underline {\underline \pink{ƛƝƧƜЄƦ}}}

Modern global warming is the result of an increase in magnitude of the so-called greenhouse effect, a warming of Earth's surface and lower atmosphere caused by the presence of water vapour, carbon dioxide, methane, nitrous oxides, and other greenhouse gases.

Similar questions