title: Generating random numbers without repeating.C#
body: <p>Hi everyone I am trying to generate 6 different numbers on the same line in c# but the problem that i face is some of the numbers are repeating on the same line.Here is my code to</p>
  <pre><code>var rand = new Random();
  List&lt;int&gt; listNumbers = new List&lt;int&gt;();
  int numbers = rand.Next(1,49);
  for (int i= 0 ; i &lt; 6 ;i++)
      {
           listNumbers.Add(numbers);
           numbers = rand.Next(1,49);
      }
  </code></pre>
  <p>somewhere my output is</p>
  <pre><code>17 23 23 31 33 48
  </code></pre>