title: C# FizzBuzz Switch Solution
body: <p>Is it possible to create the FizzBuzz solution in C# with the switch construct. I've found solutions that work for JavaScript and other languages, but these (or the syntax equivalent) don't seem to be working in C#.</p>
  
  <p>For reference, I'll write the if statement version down below:</p>
  
  <pre><code>for (int x = 1; x &lt;= 15; x++)
          {
              if (x % 5 == 0 &amp;&amp; x % 3 == 0)
                  Console.WriteLine("FizzBuzz");
              else if (x % 5 == 0)
                  Console.WriteLine("Buzz");
              else if (x % 3 == 0)
                  Console.WriteLine("Fizz");
              else
                  Console.WriteLine(x);
          }
          Console.ReadLine();
  </code></pre>
  
  <p>EDIT: forgot to put my switch statement code, sorry about that:</p>
  
  <pre><code>for (x = 1; x &lt;= 15; x++)
  {
      switch (x)
      {
          case (x % 3 == 0 &amp;&amp; x % 5 == 0):
              Console.WriteLine("FizzBuzz");
              break;
          case (x % 5 == 0):
              Console.WriteLine("Buzz");
              break;
          case (x % 3 == 0):
              Console.WriteLine("Fizz");
              break;
          default:
              Console.WriteLine(x);
              break;
      }
  }
  </code></pre>
  
  <p>My problem is with the modulo statements. Error is "Cannot implicitly convert type bool to int. I've tried replacing <code>switch (x)</code> with <code>switch (true)</code> but that doesn't help much, just changes the error to "A constant value is expected" for each of my cases.</p>