They're are more possible ways to do this than you could ever imagine, but here's a simple but fairly inefficent way. (I'm gonna assume you know pascal, 'cause i don't. )
You have a set (or an array) of numbers of a given size. You start with the first number and see if it's bigger than the second, if it is, switch it.
Regardless, test the second and third numbers in the same way.
Sort until no switches take place
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
how can you make the program sort a set of numbers in order
They're are more possible ways to do this than you could ever imagine, but here's a simple but fairly inefficent way. (I'm gonna assume you know pascal, 'cause i don't. )
You have a set (or an array) of numbers of a given size. You start with the first number and see if it's bigger than the second, if it is, switch it.
Regardless, test the second and third numbers in the same way.
Sort until no switches take place
You might try a search on a couple of alogorithms, like:
bubble sort
shell sort
I tried a quick google on "shell sort pascal" and came up with a number of useful hits, including code listings.
google is our friend. :-)
Wayne