I made a program to generate 7 random numbers for a lottery using a array. I have generated a random number between 1, 50 but every number shows in order and not on the same line. I would also like to store the auto generated numbers in a array to use. I am not sure how to fix this any help would be appreciated

```
static void AutoGenrateNumbers()
{
    int temp;
    int number = 0;
    int[] lotto = new int[7];

    Random rand = new Random();

    for (int i = 0; i <= 50; i++)
    {
        number = 0;
        temp = rand.Next(1, 50);

        while (number <= i)
        {
            if (temp == number)
            {
                number = 0;
                temp = rand.Next(1, 50);
            }
            else
            {
                number++;
            }
        }

        temp = number;
        Console.WriteLine($"the new lotto winning numbers are:{number}Bonus:{number}");
    }
}

```