# A C# Code Solution for FizzBuzz

I read a slashdot article earlier today which lead me to a Coding Horror article: Why Can’t Programmers.. Program?. This lead me to the FizBuzz problem, which prompted me to write my own quickie solution in C# (as a console application).

### Problem:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

#### My Quick Solution:

for (int i = 1; i &lt;= 100; i++)
{
if ((i % 3 == 0) &amp;&amp; (i % 5 == 0))
{
Console.WriteLine(&quot;FizzBuzz&quot;);
}
else if (i % 3 == 0)
{
Console.WriteLine(&quot;Fizz&quot;);
}
else if (i % 5 == 0)
{
Console.WriteLine(&quot;Buzz&quot;);
}
else
{
Console.WriteLine(i.ToString());
}

}