Untitled

mail@pastecode.io avatar
unknown
csharp
7 months ago
666 B
3
Indexable
Never
static void Main(string[] args)
        {
            List<int> listNumbers = new List<int>();
            listNumbers.Add(1);
            listNumbers.Add(2);
            listNumbers.Add(3);
            listNumbers.Add(4);
            listNumbers.Add(5);
            listNumbers.Add(6);

            for (int i = 0; i < listNumbers.Count; i++)
            {
                Console.WriteLine(listNumbers[i]);
            }

            Console.WriteLine("----------------------");

            foreach (int number in listNumbers)
            {
                Console.WriteLine(number);
            }

            Console.ReadLine();
        }
Leave a Comment