How to add items to IList in C#

1 Answer

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

public class Program
{
    public static void Main(string[] args)
    {
        IList<double> lst = new List<double>();

        lst.Add(3.14);
        lst.Add(898.9089);
        lst.Add(0.007);
        
        Console.WriteLine(string.Join(", ", lst));
    }
}



/*
run:

3.14, 898.9089, 0.007

*/

 



answered Mar 4, 2024 by avibootz

Related questions

1 answer 135 views
135 views asked Mar 4, 2024 by avibootz
1 answer 149 views
1 answer 143 views
1 answer 171 views
171 views asked Dec 3, 2020 by avibootz
1 answer 234 views
...