← Back to Arrays
Question 96
Sort an Array Ascending
Sort an Array Ascending
Read an integer N, then N integers into an array. Sort the array in ascending order (for example using bubble sort), then print all elements on one line separated by single spaces. Example: input '5' then '5 3 8 1 2' prints the output shown in Expected Output.
Expected Output:
1 2 3 5 8= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
Arrays
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.