bubble sort logic error
<p>I was trying a basic sorting exercise and I was hoping I could receive some help with what is probably a basic logic error.</p>

<pre><code>int[] numbers = new int[] { 2, 5, 11, 38, 24, 6, 9, 0, 83, 7 };
        for (int loop = 0; loop &lt; numbers.Length; loop++)
        {
            Console.WriteLine(numbers[loop]);
        }
        Console.WriteLine("Performing a bubble sort");

        bool flag = false;
        do
        {

            for (int loop = 0; loop &lt; numbers.Length - 1; loop++)
            {
                if (numbers[loop] &gt; numbers[loop + 1])
                {

                    int temporary = numbers[loop];
                    numbers[loop] = numbers[loop + 1];
                    numbers[loop + 1] = temporary;
                    flag = true;
                }

            }
        } while (flag == false);

        for (int loop = 0; loop &lt; numbers.Length; loop++)
        {
            Console.WriteLine(numbers[loop]);
        }
</code></pre>

<p>kind regards</p>

<p>arianule</p>
