Advertisement
Phr0zen_Penguin

99 Bottles of Beer (with secure consumption)

Dec 22nd, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.44 KB | None | 0 0
  1. /*============================================================================
  2.   ----------------------------------------------------------------------------
  3.   99_bottles.c - 99 Bottles Of Beer Lyrics.
  4.         (c) Damion 'Phr0z3n.dev' Tapper, 2013.
  5.         Email: Phr0z3n.Dev@Gmail.com
  6.  
  7.   NOTE: Secure API is implemented for responsible drinking.
  8.   ----------------------------------------------------------------------------
  9.   ============================================================================*/
  10.  
  11. #include <stdio.h>
  12.  
  13. int main(void)
  14. {
  15.     int bottles_of_beer;
  16.  
  17.     printf_s(">>------------------> 99 Bottles Of Beer Lyrics <------------------<<\n\n");
  18.  
  19.         for(bottles_of_beer = 99; bottles_of_beer > 0; bottles_of_beer--)
  20.         {
  21.             printf_s("%d bottle", bottles_of_beer);
  22.  
  23.                 if(bottles_of_beer != 1)
  24.                     printf_s("s");
  25.  
  26.             printf_s(" of beer on the wall, %d bottle", bottles_of_beer);
  27.  
  28.                 if(bottles_of_beer != 1)
  29.                     printf_s("s");
  30.  
  31.             printf_s(" of beer.\n");
  32.             printf_s("Take one down and pass it around, ");
  33.  
  34.                 if((bottles_of_beer - 1) != 0)
  35.                     printf_s("%d", bottles_of_beer - 1);
  36.                 else
  37.                     printf_s("no more");
  38.  
  39.             printf_s(" bottle");
  40.  
  41.                 if((bottles_of_beer - 1) != 1)
  42.                     printf_s("s");
  43.  
  44.             printf_s(" of beer on the wall.\n\n");
  45.         }
  46.  
  47.     printf_s("No more bottles of beer on the wall, no more bottles of beer.\n");
  48.     printf_s("Go to the store and buy some more, 99 bottles of beer on the wall.\n");
  49.  
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement