title: How to implement Method that calls itself?
body: <p>I got my wrist slapped because in an assignment i had a method call itself when an input error was made. I have no idea how to or what to use instead of the code i wrote. I need help to find the correct way on how to do it.</p>
  
  <p>I love to code so i just need a nudge in the right way! :)</p>
  
  <p>The code i had written looks like this. </p>
  
  <pre><code> private void SumTheNumbers()
   {
   Console.Write("Please give the value no "+ index + " :");
          if (false == int.TryParse(Console.ReadLine(), out num))
          { 
              //Errormessage if the user did not input an integer.
              Console.WriteLine("Your input is not valid, please try again.");
              Console.WriteLine();
              sum = 0;
              SumTheNumbers();
          }
          else
          {
              //Calculate the numbers given by user
              sum += num;
          }
    }
  </code></pre>