using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kabarcik
{
class Program
{
static void Main(string[] args)
{
//Kabarcık Sıralaması
int[] Array = new int[10] { 7, 70, 14, 77, 15, 17, 87, 19, 33, 99 };
Console.Write("Sıralama yapılacak dizi ");
foreach (int x in Array)
Console.Write(x + " ");
Console.WriteLine();
int i;
int j;
int TempValue;
for (i = (Array.Length - 1); i >= 0; i--)
{
for (j = 1; j <= i; j++)
{
if (Array[j - 1] > Array[j])
{
TempValue = Array[j - 1];
Array[j - 1] = Array[j];
Array[j] = TempValue;
}
}
}
Console.Write("Sıralanmamış dizi ");
foreach (int y in Array)
Console.Write(y + " ");
Console.ReadKey();
}
}
}