Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- //finds all even numbers
- public static class Test
- {
- static void Main()
- {
- List<int> list = new List<int>() { 1, 2, 3, 4, 5, 6 };
- List<int> evenNumbers = list.FindAll(x => (x % 2) == 0);
- foreach (var num in evenNumbers)
- {
- Console.Write("{0} ", num);
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment