Created
November 8, 2018 20:21
-
-
Save joe-scalise/b442917e8b951d071a9263b5a8b39bdb to your computer and use it in GitHub Desktop.
FizzBuzz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace FizzBuzz | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| for (int n = 1; n <101; n++){ | |
| if (n%3 == 0) { | |
| if (n%5 == 0) { | |
| Console.WriteLine("FizzBuzz"); | |
| continue; | |
| } else { | |
| Console.WriteLine("Fizz"); | |
| } | |
| } | |
| else if (n%5 == 0) { | |
| Console.WriteLine("Buzz"); | |
| } | |
| else { | |
| Console.WriteLine(n.ToString()); | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment