CSharp examples for Language Basics:Tuple
Create Fibonacci Without Tuples
using System;//from ww w . ja va 2 s .c om using System.Collections.Generic; using System.Linq; class FibonacciWithoutTuples { static void Main() { foreach (var value in Fibonacci().Take(10)) { Console.WriteLine(value); } } static IEnumerable<int> Fibonacci() { int current = 0; int next = 1; while (true) { yield return current; int nextNext = current + next; current = next; next = nextNext; } } }