Contains
Shohruh Nosirov
class Program
{
static void Main(string[] args)
{
List<int> sonlar = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
//Ekranga chiqaramiz
Console.WriteLine("Boshlangich elementlar:");
foreach(var i in sonlar)
{
Console.Write(i + " ");
}
bool bor = sonlar.Contains(5);
Console.WriteLine("\nElementlar orasida 5 bor ekanligini tekshiramiz:");
if(bor)
{
Console.WriteLine("Bor");
}
else
{
Console.WriteLine("Yuq");
}
Console.ReadKey();
}
}Last updated
Was this helpful?