Max
Jasurbek Sariboyev
using System;
using System.Collections.Generic;
using System.Linq;
namespace maxMin
{
class Program
{
static void Main()
{
IList<int> list = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11 };
var maxElement = list.Max();
Console.WriteLine("Maksimum Element: {0}", maxElement);
var maxElement1 = list.Max(l =>
{
if (l % 2 == 0)
return l;
return 0;
});
Console.WriteLine("Shartni qanoatlantirgan Maksimum Element: {0}", maxElement1);
}
}
}Last updated
Was this helpful?