Skip to content

Instantly share code, notes, and snippets.

@jumboly
Created April 1, 2012 15:03
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 jumboly/2276015 to your computer and use it in GitHub Desktop.
Save jumboly/2276015 to your computer and use it in GitHub Desktop.
FizzBuzz 2012/04/01
using System;
using System.Linq;
class Program {
static void Main(string[] args) {
foreach (var i in Enumerable.Range(1, 100)) {
Console.WriteLine(
i % 3 == 0 && i % 5 == 0 ? "FizzBuzz" :
i % 3 == 0 ? "Fizz" :
i % 5 == 0 ? "Buzz"
: ""+i
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment