Skip to content

Instantly share code, notes, and snippets.

@profesor79
Created March 22, 2023 15:23
Show Gist options
  • Save profesor79/68669f92b19ed9d6e4534b9cf3ced45b to your computer and use it in GitHub Desktop.
Save profesor79/68669f92b19ed9d6e4534b9cf3ced45b to your computer and use it in GitHub Desktop.
public void FizzBuzz()
{
const string FIZZ = "Fizz";
const string BUZZ = "Buzz";
const string FIZZBUZZ = "FizzBuzz";
int i = 0;
while (i < 150)
{
Console.WriteLine(++i);
Console.WriteLine(++i);
Console.WriteLine(FIZZ); ++i;
Console.WriteLine(++i);
Console.WriteLine(BUZZ); ++i;
Console.WriteLine(FIZZ); ++i;
Console.WriteLine(++i);
Console.WriteLine(++i);
Console.WriteLine(FIZZ); ++i;
Console.WriteLine(BUZZ); ++i;
Console.WriteLine(++i);
Console.WriteLine(FIZZ); ++i;
Console.WriteLine(++i);
Console.WriteLine(++i);
Console.WriteLine(FIZZBUZZ); ++i;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment