Count numbers > 5 in 1..11.
Ready — edit the code above and click Run.
using System;
class Program
{
static void Main()
{
using System.Linq;
Console.WriteLine(Enumerable.Range(1, 11).Count(x => x > 5));
}
}
Try solving on your own first, then reveal the official answer.
Count with predicate.