C#-এ লিস্টে ইন্টিজার ভ্যালু যোগ করতে Add() মেথড ব্যবহার করুন।
প্রথমে C#-এ একটি ইন্টিজার লিস্ট ডিক্লেয়ার করুন −
List<int> list1 = new List<int>();
এখন ইন্টিজার ভ্যালু যোগ করুন −
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<int> list1 = new List<int>(); list1.Add(900); list1.Add(400); list1.Add(300); Console.WriteLine(list1.Count); } } }