C# এ Min() পদ্ধতি ব্যবহার করে একটি সিকোয়েন্স থেকে সর্বনিম্ন মান পান।
নিম্নলিখিত আমাদের তালিকা.
List<long> list = new List<long> { 1, 2, 3, 4, 5, 6 }; এখন, ন্যূনতম উপাদান পেতে Queryable Min() পদ্ধতি ব্যবহার করুন।
list.AsQueryable().Min();
উদাহরণ
using System;
using System.Collections.Generic;
using System.Linq;
class Demo {
static void Main() {
List<long> list = new List<long> { 1, 2, 3, 4, 5, 6 };
foreach(long ele in list) {
Console.WriteLine(ele);
}
// getting lowest element
long min_num = list.AsQueryable().Min();
Console.WriteLine("Smallest number = {0}", mix_num);
}
}