title: Random guessing game stuck
body: <p>I am practicing the basics of C programming using the book SAMS Teach yourself C in 21 days. </p>
  
  <p>On one of the type and run sections, they have the find the number (or guess the number) program, I typed it and run it, however the program on the console gets stuck showing the following: </p>
  
  <p>Getting a random number</p>
  
  <p>I waited for some time but nothing happens, even pushing some keys it doesn't do anything. </p>
  
  <p>I am not familiar yet with the srand(), time() and rand() routines so I don't know how to fix it and make it run properly. </p>
  
  <p>below is the code: </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  #define NO 0
  #define YES 1
  
  int main (void)
  {
      int guess_value = -1;
      int number;
      int nbr_of_guesses;
      int done = NO;
  
  
      printf("\nGetting a random number\n");
  
      /*use the time to seed the random number generator*/
  
      srand( (unsigned) time(NULL)); 
      number = rand();
  
  
      nbr_of_guesses = 0;
  
      while (done == NO);
      {
          printf("\nPick a number between 0 and %d&gt;", RAND_MAX);
          scanf("%d", &amp;guess_value); /*get a number*/
  
          nbr_of_guesses++;
  
          if (number == guess_value)
          {
              done = YES;
          }
          else
              if (number &lt; guess_value)
              {
                  printf("\nYou guessed high!");
              }
              else
              {
                  printf("\nYou guessed low!");
              }
  
      }
  
      printf("\nCongratulations! you guessed right in %d Guesses!", nbr_of_guesses);
      printf("\n\nThe number was %d", number);
  
      return 0;
  }
  </code></pre>