title: Using random rnd inside a method causes multiple errors
body: <p>Having problem with the method down below. The current error I get is "it does not return any value" If I put the return num outside of the brackets, it does not exist in the current context.
  If I remove the brackets all together I get:</p>
  
  <p>Embedded statement cannot be a declaration or labeled statement
  The name 'rnd' does not exist in the current context</p>
  
  <p>I've done multiple methods before without this issue. What am I missing?</p>
  
  <pre><code> public static int generateNumber(int timesUserWantsToGuess)
          {
              for (int i = 0; i &lt;= timesUserWantsToGuess; i++)
              {
                  Random rnd = new Random();
                  int num = rnd.Next(1, 50);
                  return num;
              }
  
  
          }
  </code></pre>