title: Input validation in C
body: <p>I'm writing a program in C. In the program, the user has to choose a number, either 1, 2 or 3. I would like to construct the code so that when the user enters in a number that isn't 1, 2 or 3, he/she will be told "Invalid selection - choose again" and then they will be brought back to the start of the program:</p>
  
  <pre><code>int main() {
  
      int choice;
      char response, Y, N;
  
      printf("Choose a shape from the following:\n 1.Sphere\n 2.Cone\n 3.Cylinder\n");
  
      scanf("%d",&amp;choice);
  
      if(choice==1||choice==2||choice==3) {
          printf("Enter the radius, r\n");                             
      } else
          printf("Invalid selection, choose again.\n");
  
  }
  </code></pre>
  
  <p>What I would like is that after "Invalid selection, choose again" appears, the user is brought back to the start of the program, so they can input their choice again. How would I do this?</p>