using System;
public class BubbleSort
{
public static void Main()
int[] array = new int[] {30,20,140,50,1,54,98,600,480,64,3,5,39,20,2};
for (int i = 0; i < array.Length - 1; i++)
for (int j = 0; j < array.Length - 1; j++)
if (array[j] > array[j + 1]) // swap the elements
int tmp = array[j];
array[j] = array[j + 1];
array[j + 1] = tmp;
}
for (int i = 0; i < array.Length; i++) // print the elements
Console.Write(array[i] + " ");