namespace Sort { class Program { static void Main(string[] args) { int[] arr = { 2,6,1,9,3,7,0,8,5,4}; //print for (int i = 0; i < arr.Length; i++) { Console.Write(arr[i]+" "); } Console.WriteLine("\n---------------------------------------"); Console.WriteLine("After sort:"); Console.WriteLine("---------------------------------------"); for (int i = 0; i<arr.Length;i++ ) { for (int j = 0; j < arr.Length-i-1; j++) { if(arr[j]>arr[j+1]) { int temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp; } } } //print for (int i = 0; i < arr.Length; i++) { Console.Write(arr[i] + " "); } Console.ReadLine(); } } }