repl.it
@kironroy/

LINQ_numberslist

C#

No description

fork
loading
Files
  • main.cs
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
using System.Linq;


namespace LINQStuff
{
    class Program
    {
        static void Main()
        {
            var numbers = new List<int> { 2, 4, 8, 16, 32, 64 };

            var numberGreaterThanTen = from number in numbers where number > 10 select number;

            foreach (int item in numberGreaterThanTen)
            {
                Console.WriteLine(item.ToString());
            }

            Console.ReadLine();

        }
    }
}