title: C# Assigning a new value to a variable
body: <p>So I'm totally new to C#, in fact i just started learning the syntax about half an hour ago. </p>
  
  <p>What i have done until now is just messing with the syntax and made an interactive input program of a few lines of code. When i was done typing my code and wanted to run the program, it gave me an error. </p>
  
  <pre><code>        Console.Write("What is your name?: ");
          string name = Console.ReadLine();    //'name' used here
          Console.WriteLine("Hello " + name);
          Console.ReadLine();
  
          Console.Write("How old are you?: ");
          int age = Convert.ToInt32(Console.ReadLine());
          Console.WriteLine("So you're name is " + name + " and you are " + age + " years old?");
          Console.ReadLine();
  
          Console.Write("Tell me, yes or no?: ");
          string answer = Console.ReadLine();
  
  
          if (answer == "no" || answer == "No")
  
          { 
             Console.Write("Ahh okay, what was your name again?: ");
             string name  = Console.ReadLine();    //'name' used here
          }
  </code></pre>
  
  <p>"A local or parameter named 'name' cannot be declared in this scope ..."</p>
  
  <p>I knew the problem had to be in the last line of code, where i assigned a new value to the string 'name'. I know for sure this is possible in PHP, assigning new values to variables. As i said im totally new to C# , i would like to know if there is a way to do this?</p>