title: Generating a random number with a range from 1 - 10
body: <pre><code>int Width()
  {
      int r = 0;
       r = rand();
       if (r &lt;= 3640)
       {
           r = (r % (10 - 1 + 1)) + 1;
           printf("%d", r);
       }
     return number;
  }
  </code></pre>
  
  <p>So I have this C code here to practice using the rand() function. As I understand it the 10-1 should be the "high"-"low" for my range and then the +1 at the end should shift it into the range that I would like. The program does throw any errors though. It just crashes. </p>