Created
February 6, 2016 03:40
-
-
Save guaracy/1cc8824a8fb1e2bf9287 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; | |
namespace ConsoleApplication11 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Program p = new Program(); | |
p.sing(); | |
} | |
public void sing() | |
{ | |
int bottles; | |
int max = 99; | |
string bottleWord = ""; | |
for (bottles = max; bottles > 0; --bottles) | |
{ | |
if (bottles == 1) | |
{ | |
bottleWord = "Bottle"; | |
} | |
else | |
{ | |
bottleWord = "Bottles"; | |
} | |
if (bottles != 99) | |
{ | |
Console.WriteLine("Take one down and pass it around"); | |
Console.WriteLine(bottles + " " + bottleWord + " of beer on the wall."); | |
Console.WriteLine(); | |
} | |
Console.WriteLine(bottles + " " + bottleWord + " of beer on the wall"); | |
Console.WriteLine(bottles + " " + bottleWord + " of beer"); | |
} | |
Console.WriteLine("Take one down and pass it around"); | |
Console.WriteLine("No more bottles of beer on the wall."); | |
Console.WriteLine(""); | |
Console.WriteLine("Go to the store and buy some more"); | |
Console.WriteLine(max + " bottles of beer on the wall."); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment