title: How to make the program restart if I press a certain button
body: <p>I've recently written this "guess the number" program. My problem is that I want the program to restart when I press "y" after the "Play again" question comes. Any ideas? :)</p>
  
  <pre><code>srand( time(NULL) );
  int secretNumber = rand()%100 + 1;
  int guess = 0;
  int counter = 0;
  
  
   printf("I'm thinking of a number between 1 and 100\n");
   printf("What is your guess?\n");
  
  while(1)
  
  {
  
   counter++; 
  
   scanf("%d", &amp;guess);
  
   if (guess == secretNumber) 
   {
       printf("It took you %d tries\n", counter); 
       printf("Play again (y/n)?\n");
       break;
  
   }
  
   if (guess &lt; secretNumber) 
    {   
       printf("Too low!\n"); 
    }
  
  
   if (guess &gt; secretNumber) 
  
   { 
       printf("Too high!\n");
   }
  </code></pre>