title: Console Application Output to .csv file
body: <p>I am trying to make a program that will show the numbers:</p>
  
  <pre><code>    1, 10   +30
      2, 40     (the scale goes up in this pattern by adding 20 to the last number added)
      3, 90   +50
      4, 160
      5, 250  +70
  </code></pre>
  
  <p>So far I have this code:</p>
  
  <pre><code> using System;
   using System.Collections.Generic;
   using System.Linq;
   using System.Text;
   using System.IO;
  
   namespace Myloop
   {
        class Program
        {
            static void Main(string[] args)
            {
                FileStream filestream = new FileStream("loopdata.csv", FileMode.Create);
                var streamwriter = new StreamWriter(filestream);
                streamwriter.AutoFlush = true;
                Console.SetOut(streamwriter);
                Console.SetError(streamwriter);
  
                 int forloop;
                 for (forloop = 1; forloop &lt; 21; forloop++)
                      Console.WriteLine(forloop);
  
                 Console.ReadLine();
  
            }
        }
   }
  </code></pre>
  
  <p>This is showing the first sequence of numbers 1 - 20, but could anyone give me any guidance how to do the other sequence next to it in the console application? And how I can output these to a .csv file, since the information I have so far doesn't appear in the .csv file.</p>