Having
public static IEnumerable<long> FibonacciNumbers() {
long current = 0;
long next = 1;
while (true) {
long previous = current;
current = next ;
next = previous + next;
yield return current;
}
}
I can get the first fibonacci numbers less that 100 with
var series = FibonacciNumbers().TakeWhile(num => num < 100);
Just being curious, how would I do that using query syntax ?