http://msdn.microsoft.com/en-us/library/bb397687.aspx has a pretty good example of finding odd numbers which will put the value of 5 into a variable called "oddNumbers" in executing.
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
int oddNumbers = numbers.Count(n => n % 2 == 1);
No comments:
Post a Comment