> For the complete documentation index, see [llms.txt](https://andreyakinshin.gitbook.io/problembookdotnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andreyakinshin.gitbook.io/problembookdotnet/en/linq/querywithinc-p.md).

# “QueryWithInc” (Problem)

What will the following code display?

```csharp
int Inc(int x)
{
  Console.WriteLine("Inc: " + x);
  return x + 1;
}
void Main()
{
  var numbers = Enumerable.Range(0, 10);
  var query =
    (from number in numbers
     let number2 = Inc(number)
     where number2 % 2 == 0
     select number2).Take(2);
  foreach (var number in query)
    Console.WriteLine("Number: " + number);
}
```

[Solution](/problembookdotnet/en/linq/querywithinc-s.md)
