title: c# - While loop coding theory, making a login and register sysem
body: <p>I have coded a system based of the theory that while loops can work anywhere in a system. So once a while loop has been passed by it can run. Here is a simple version of my code:</p>
  
  <pre><code>using System;
  
  namespace test___login
  {
      class Program
      {
          static void Main(string[] args)
          {
              string location = "homepage";
              while (location.Equals("Homepage", StringComparison.InvariantCultureIgnoreCase))
  
              {
                  Console.WriteLine("homepage");
                  Console.WriteLine("WHere to now: ");
                  location = Console.ReadLine();
              }
              while (location.Equals("login", StringComparison.InvariantCultureIgnoreCase))
              {
                  Console.WriteLine("login");
                  Console.WriteLine("Where to now: ");
                  location = Console.ReadLine();
              }
          }
      }
  }
  </code></pre>
  
  <p>So I assumed that once the variable changes from "login" to "homepage" in the second while loop, would mean the first while loop would run once again. Is my theory on how the code works wrong or am i simply not typing the right thing. I just started last week so sorry for the basic question</p>