Guest User

Untitled

a guest
Feb 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. using System.Collections.Generic;
  2.  
  3. namespace FibonacciTest
  4. {
  5. public static class FibonacciGenerator
  6. {
  7. public static IEnumerable<int> Fibonacci()
  8. {
  9. int current = 1, next = 1;
  10. while (true)
  11. {
  12. yield return current;
  13. next = current + (current = next);
  14. }
  15. }
  16. }
  17. }
Add Comment
Please, Sign In to add comment