title: StreamReader output
body: <p>In C# why output of this 2 code is different from each other  ?</p>
  
  <pre><code>StreamReader test = new StreamReader(@"C:\a.txt");
  
  while (test.ReadLine() != null)
  {
      Console.WriteLine(test.ReadLine());
  }
  </code></pre>
  
  <p>And this code :</p>
  
  <pre><code>StreamReader test = new StreamReader(@"C:\a.txt");
  
  string line = "";
  
  while ((line = test.ReadLine()) != null)
  {
      Console.WriteLine(line);
  } 
  </code></pre>