title: Running a program gives me different results from debugging mode
body: <p>I've provided a simple code which will output 10 random digits that are in between 0 and 100. When I run this in visual studio (C#) using F5, I get the same number 10 times. However, if I run it through debugging mode, line by line using F10 or F11, I get 10 different numbers (may not be all different but they are randomized). </p>
  
  <pre><code>public static void rand() {
      for (int j = 0; j &lt; 10; j++) {
          Random r = new Random();
          Console.WriteLine( r.Next(100));
      }   
  }
  </code></pre>
  
  <p>I know how to fix the issue, which is by instantiating Random r outside of the loop and copy by reference, but I would like to understand why this is happening. I'm thinking that this has something to do with the seed but the program does work while running under debugging mode which confuses me.</p>
  
  <p>Also, now I'm questioning if I'll always need to test whether or not debugging mode is giving me the right results.</p>