title: generate random float number ranging [0,1] in c
body: <p>When I used <code>rand()</code> with <code>srand()</code> to generate random number in [0,1], it gave me numbers like: 0.70324, 0.70328, 0.70321...</p>
  <p>They were difference only in the last one or two digits, while I was intended to get random float numbers like 0.1,0.7,0.3....</p>
  <p>How could I get random float number like that instead of making difference in the last digit?</p>
  <p>Here's my code:</p>
  <pre><code>#include &lt;time.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  
  int main(){
      int i;
      float randomNum;
      for (  i=0; i&lt;10; i++){
          srand((unsigned int)time(NULL));
          randomNum = ((float)rand())/RAND_MAX;
          printf(&quot;%f\n&quot;,randomNum);
       }
      return 0;
  }
  </code></pre>