title: How can I make a program loop back to the start if else is true? C#
body: <p>Couldn't find any other answer on the site that covers this. If else is run and an error message is displayed, is it possible to restart the program by looping back to the start instead of restarting the console?</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          int User;
          int Array;
          StreamWriter outfile = new StreamWriter("C://log.txt");
          Console.WriteLine("Input an number between 1 and 100");
          User = Convert.ToInt32(Console.ReadLine());
          if (User &lt; 101 &amp;&amp; User &gt; 0)
          {
              for (Array = 1; Array &lt;= User; Array++)
              {
                  Console.WriteLine(Array + ", " + Array * 10 * Array);
                  outfile.WriteLine(Array + ", " + Array * 10 * Array);
              }
              {
                  Console.WriteLine("Press Enter To Exit The Console");
                  outfile.Close();
                  Console.ReadLine();
              }
          }
  
          else
              {
              Console.WriteLine("Sorry you input an invalid number. ");
              Console.ReadLine();
              }
      }
  }
  </code></pre>
  
  <p>Sorry! To be more clear I need to make the Program start again if the user inputs an invalid number</p>
  
  <p>Thanks for the help!</p>