Reading the coding horror, I just came across the FizzBuzz another time.
The original post is here: Coding Horror: Why Can\'t Programmers.. Program?
For thos
Not the most efficient, but here's one using C#-6 string interpolation:
void Main() { for (int i = 1; i <= 100; i++) { Console.WriteLine($"{(i % 15 == 0 ? "FizzBuzz" : i % 3 == 0 ? "Fizz" : i % 5 == 0 ? "Buzz" : i.ToString())}"); } }