static bool GetOdd(int number)
{
if (number % 2 != 0)
return true;
else
return false;
}
{
if (number % 2 != 0)
return true;
else
return false;
}
var result = from r in
Enumerable.Range(1, 50).Where(GetOdd)
select r;
foreach (var r in result)
Console.WriteLine(r);
Console.ReadKey(true);
Enumerable.Range(1, 50).Where(GetOdd)
select r;
foreach (var r in result)
Console.WriteLine(r);
Console.ReadKey(true);
No comments:
Post a Comment