title: c# probability and random numbers
body: <p>I've seen this question asked in a number of ways, but I just need a sanity check of what I'm doing here.</p>
  
  <p>Basically I want to trigger an event with a probability of 25% based on a random number generated between 1 and 100 using:</p>
  
  <pre><code>int rand = random.Next(1,100);
  </code></pre>
  
  <p>Will the following achieve this?</p>
  
  <pre><code>if (rand&lt;=25)
  {
      // Some event...
  }
  </code></pre>
  
  <p>I thought I would use a number between 1 and 100 so I can tweak the probabilities later on - e.g. adjust to 23% by using </p>
  
  <pre><code>if (rand&lt;=23) {...}
  </code></pre>
  
  <p>Thanks for taking a look.</p>