C# में लिस्ट में इंटीजर वैल्यूज़ जोड़ने के लिए, Add() मेथड का उपयोग करें।
सबसे पहले, C# में एक इंटीजर लिस्ट घोषित करें:
Listlist1 = new List ();
अब इंटीजर वैल्यूज़ जोड़ें:
list1.Add(900); list1.Add(400); list1.Add(300);
आइए पूरा कोड देखें:
उदाहरण
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Demo { public class Program { public static void Main(String[] args) { List list1 = new List(); list1.Add(900); list1.Add(400); list1.Add(300); Console.WriteLine(list1.Count); } } }