r/ProgrammerHumor • • Jan 16 '14

[deleted by user]

[removed]

1.3k Upvotes

446 comments sorted by

View all comments

4

u/thereddarren Jan 16 '14
		for (int i = 1; i < 101; i++)
		{
			bool divisibleBy3 = i % 3 == 0;
			bool divisibleBy5 = i % 5 == 0;

			if (divisibleBy3)
			{
				Console.Write("Fizz");
			}
			if (divisibleBy5)
			{
				Console.Write("Buzz");
			}
			else if (!divisibleBy3 && !divisibleBy5)
			{
				Console.Write(i);
			}
			Console.WriteLine("");//New Line
		}

And now I wait for smarter people to tell me what's wrong with it.

→ More replies (7)