Program to find even elements from Array Collection in C# using System.Array Class

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 173
Array.ForEach
(
new int[] { 23, 56, 78, 11, 9, 1, 2, 3, 4, 5, 6, 100, 98, 201, 54 }, element =>
{
if(element % 2 == 0) Console.WriteLine(element);
}
);
Result
------
56
78
2
4
6
100
98
54

Comments or Responses

Login to post response