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);
}
}
}