using System;
class Program
{
static void Main()
{
int[] array = { 5, 3, 9, 2, 7 };
for (int i = 0; i < array.Length - 1; i++)
{
for (int j = 0; j < array.Length - 1 - i; j++)
{
if (array[j] > array[j + 1])
{
int temp = array[j];
array[j] = array[j + 1];
array[j + 1] = temp;
}
}
}
Console.WriteLine("Sorted Array: " + string.Join(", ", array));
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: