Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void FizzBuzz(int n)
- {
- Console.WriteLine(string.Join(Environment.NewLine, Enumerable.Range(1, n).Select(x => { return x % 15 == 0 ? "FizzBuzz" : x % 5 == 0 ? "Buzz" : x % 3 == 0 ? "Fizz" : x.ToString(); })));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement