title: How to generate varying random numbers?
body: <pre><code>void main()
  {
     int i,sample;
     clrscr();
     for(i=0;i&lt;5;i++)
     {
        sample=rand();
        printf("%d\n",sample);
     }
     getch();
  }
  </code></pre>
  
  <p>For the above code, every time I execute, the same random numbers 346,130,10982,1090,11656 are generated. But I need to generate varying random numbers when I execute the code. </p>
  
  <p>Can anyone help me?</p>