title: c# allow user to input again until correct
body: <p>I am making an ATM in c#. One of its functions is letting a user transfer money between their accounts. How can I make it so that if the user enters an invalid amount to transfer (such as a negative amount), the user will be prompted to enter an amount again until it is valid? I tried using a while loop but as soon as I entered a negative value line "Please enter a valid amount to transfer" just kept repeating nonstop.</p>
  
  <pre><code>Console.WriteLine("How much would you like to transfer?");
                  double transferamt = double.Parse(Console.ReadLine());
                  if (transferamt &lt; 0)
                  {
                      Console.WriteLine("Please enter a valid amount to transfer");
  
                  }              
  </code></pre>