Created
November 9, 2015 17:28
-
-
Save anonymous/5abe9e3ca45fecd7a3fa to your computer and use it in GitHub Desktop.
This file contains 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; | |
class BuzzFizz | |
{ | |
static void Main() | |
{ | |
Console.Write("Enter the starting positive integer number: "); | |
uint start = uint.Parse(Console.ReadLine()); | |
Console.Write("Enter the ending positive integer number: "); | |
uint end = uint.Parse(Console.ReadLine()); | |
uint arrNum = end - start; | |
uint[] endArr = new uint[arrNum]; | |
for (uint i = 0; i <= endArr.Length; i++) | |
{ | |
if (start % 5 == 0 && start % 3 == 0) | |
{ | |
string buzz = "Buzz-Fizz"; | |
Console.WriteLine(buzz); | |
} | |
else if (start % 3 == 0) | |
{ | |
string buzz = "Buzz"; | |
Console.WriteLine(buzz); | |
} | |
else if (start % 5 == 0) | |
{ | |
string buzz = "Fizz"; | |
Console.WriteLine(buzz); | |
} | |
else Console.WriteLine(start); | |
++start; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment