Marc

Marc

  • NA
  • 205
  • 54.1k

99 bottles

Nov 18 2014 8:00 AM
So I heard about a exercise about the song "99 Bottles of Beer", so I tired it and this is what I came up with....
 
for (int i = 99; i >= 1; i--){
 
Console.WriteLine(" '" + i + "' bottles of beer on the wall, '" + i + "' bottles of beer.");

i--;Console.WriteLine(" Take one done and pass it around '" + i + "' bottles of beer on the wall.");

i++;if (i == 1)

{Console.WriteLine(" Thanks for playing but I'm out!!!");

break;

}

}
 
 
You know of any other ways to programmatically execute this song?
 

Answers (5)