using System;
using System.Linq;
public class Program
{
public static void Main()
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
// As TakeWhile iterates over the array:
// "n" is the value of the element
// "index" is the index of the element
var firstSmallNumbers = numbers.TakeWhile((n, index) => n >= index);
foreach(var n in firstSmallNumbers)
Console.WriteLine(n);
}