public static void Main(string[] args)
int[] vetor = new int[10];
Random rnd = new Random();
Console.WriteLine("Vetor Desordenado\n");
for (int i = 0; i < vetor.Length; i++)
vetor[i] = rnd.Next(1, 100);
Console.WriteLine("Elemento: {0}", vetor[i]);
bubbleSort(vetor, vetor.Length);
Console.WriteLine("\nVetor Ordenado-- \n");
for (int i = 0; i < vetor.Length; i++)
Console.WriteLine("Elemento: {0} ", vetor[i]);
static void bubbleSort(int[] vetor, int length)
for (int i = 0; i < length - 1; i++)
for (int j = 0; j < length - 1; j++)
if (vetor[j] > vetor[j + 1])