Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,166 questions

40,722 answers

573 users

How to generate a list of numbers in C#

1 Answer

0 votes
using System;
using System.Collections.Generic;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> list = new List<int>();

            for (int i = 0; i < 10; i++)
                list.Add(i);

            Console.WriteLine(String.Join(" ", list));
        }
    }
}


/*
run:

0 1 2 3 4 5 6 7 8 9

*/

 





answered Jul 28, 2018 by avibootz

Related questions

1 answer 81 views
81 views asked Jul 30, 2018 by avibootz
2 answers 83 views
1 answer 28 views
2 answers 137 views
...