How to print random values between certain range? : <p>I am writing a basic crypto program using c language. In that i want to get a random numbers form certain range say (97 to 122). I saw this program on some programming website.</p>

<pre><code>int main(void) 
{
  int c, n;

  printf("Ten random numbers in [1,100]\n");

  for (c = 1; c &lt;= 10; c++) 
  {
    n = rand() % 100;
    printf("%d\n", n);
  }

}
</code></pre>

<p>but it prints random values from 1 to 100. 
In python we implement it with the help of <code>rand()</code> function eg: <code>r = random.randint(97, 122)</code>. so is there any way to implement like this in c program.</p>
