I\'m having some trouble with this problem in Project Euler.
Here\'s what the question asks:
Each new term in the Fibonacci sequence is generated by adding t
Joel, I wrote a very some similiar code; I'm posting it anyways:
static IEnumerable Fibonacci(int maximum)
{
int auxiliar = 0;
int previous = 0;
int current = 1;
while (current < maximum)
{
auxiliar = previous;
previous = current;
current = auxiliar + current;
yield return current;
}
}
Console.WriteLine(Fibonacci(4000000).Where(number => number % 2 == 0).Sum());