C# Console Application Output to .csv file

Posted by Zinn on Stack Overflow See other posts from Stack Overflow or by Zinn
Published on 2013-10-31T21:46:52Z Indexed on 2013/10/31 21:53 UTC
Read the original article Hit count: 156

Filed under:
|

I am trying to make a program that will show the numbers:

    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

So far I have this 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)

    /// </summary>
    {


        StreamWriter myOutputStream = new StreamWriter("loopdata.csv");



        int forloop;
        for (forloop = 1; forloop < 21; forloop++)
            Console.WriteLine(forloop);
        Console.ReadLine();

        myOutputStream.Close();

       }
    }
 }

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, as the information I have so far doesn't appear in the .csv file

© Stack Overflow or respective owner

Related posts about c#

Related posts about csv