All
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 juft = sonlar.All(x => x % 2 == 0);
Console.WriteLine("\nBarcha elementlar juft ekanligini tekshiramiz:");
if(juft)
{
Console.WriteLine("Barchasi juft");
}
else
{
Console.WriteLine("Barchasi juft emas");
}
Console.ReadKey();
}
}Last updated
Was this helpful?