c# FizzBuzz Test

Post Reply
User avatar
jessica
Site Admin
Posts: 31
Joined: Thu Sep 06, 2018 3:17 pm
Location: Cincinnati, Ohio
Contact:

c# FizzBuzz Test

Post by jessica » Thu Sep 06, 2018 4:41 pm




using System;
public class Test
{
public static void Main()
{
for (int i = 1; i <= 100; i++) {
Console.WriteLine(i%3==0 && i%5==0 ? "FizzBuzz" : (i%3==0 ? "Fizz" : (i%5==0 ? "Buzz" : i.ToString())));
}
}
}
Post Reply