FizzBuzz Test

This is all over the blogs today:

CodingHorror.com. Jeff Atwood writes a great post entitled Why Can’t Programmers.. Program?

Just for kix, I did it, just so I knew I wasn’t crazy :)

for(int i = 1; i < 101; i++)
{
if(i % 3 == 0 && i % 5 == 0)
{
Console.WriteLine("FizzBuzz");
}
else if(i % 3 == 0)
{
Console.WriteLine("Fizz");
}
else if(i % 5 == 0)
{
Console.WriteLine("Buzz");
}
else
{
Console.WriteLine(i.ToString());
}

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s