Sorting an Array

Download the following code, and get it to compile.

Files Needed

What You Should See

before: 45 87 39 32 93 86 12 44 75 50
after : 45 87 39 32 93 86 12 44 75 50

After you add in the code you're supposed to, you should see something more like this:

before: 45 87 39 32 93 86 12 44 75 50
after : 12 32 39 44 45 50 75 86 87 93

What You Should Do on Your Own

Assignments turned in without these things will receive no credit.

  1. Use nested loops, an if statement, and some "swapping" code to rearrange the values in the array so that they're in order from smallest to largest.



©2013 Graham Mitchell

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Creative Commons License