// sort int array
int[] intArray = new int[5] { 8, 10, 2, 6, 3 };
Array.Sort(intArray);
// write array
foreach (int i in intArray) Console.Write(i + " ");
//OUTPUT
2 3 6 8 10
Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/XAjB9RinXZI/14309