Skip to content

Instantly share code, notes, and snippets.

@tikluganguly
Created March 30, 2012 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tikluganguly/2252339 to your computer and use it in GitHub Desktop.
Save tikluganguly/2252339 to your computer and use it in GitHub Desktop.
FizzBuzz in LINQ
Enumerable.Range(1, 100).ToList().ForEach(i => Console.WriteLine((i % 3 == 0 && i % 5 == 0) ? "FizzBuzz" : (i % 5 == 0) ? "Buzz" : (i % 3 == 0) ? "Fizz" : i.ToString()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment