#C
C
This program is generating the complete song text as single string using the preprocessor. The actual C code just outputs the string thus constructed. Calling strings on the generated executable will reveal the complete song text in the executable.
#define BOTTLES(n) n " bottles of beer" #define BOTTLE "1 bottle of beer" #define OTW " on the wall, " #define TAKE "Take one down, pass it around, " #define BUY "Go to the store and buy some more, " #define STOP "." #define NL "\n" #define LINE1(n) BOTTLES(n) OTW BOTTLES(n) STOP NL #define LINE1A BOTTLE OTW BOTTLE STOP NL #define LINE2(n) TAKE BOTTLES(n) STOP NL #define LINE2A TAKE BOTTLE STOP NL #define LINEX BUY BOTTLES("99") NL #define MIDDLEPART(n) LINE2(n) NL LINE1(n) #define MIDDLELAST LINE2A NL LINE1A #define EIGHT_TO_TWO(S, M) M(S "8") M(S "7") M(S "6") M(S "5") M(S "4") M(S "3") M(S "2") #define EIGHT_TO_ONE(S, M) EIGHT_TO_TWO(S, M) M(S "1") #define EIGHT_TO_TWO_AGAIN(S, M) M(S "8") M(S "7") M(S "6") M(S "5") M(S "4") M(S "3") M(S "2") #define EIGHT_TO_ONE_AGAIN(S, M) EIGHT_TO_TWO_AGAIN(S, M) M(S "1") #define NINE_TO_TWO(S, M) M(S "9") EIGHT_TO_TWO(S, M) #define EIGHT_TO_ZERO(S, M) EIGHT_TO_ONE(S, M) M(S "0") #define NINE_TO_ZERO(S, M) M(S "9") EIGHT_TO_ZERO(S, M) #define NINETIES EIGHT_TO_ZERO("9", MIDDLEPART) #define NTIES(n) NINE_TO_ZERO(n, MIDDLEPART) #define EIGHTIES_TO_TENS EIGHT_TO_ONE_AGAIN("", NTIES) #define NAUGHTIES NINE_TO_TWO("", MIDDLEPART) #define SONG LINE1("99") NINETIES EIGHTIES_TO_TENS NAUGHTIES MIDDLELAST LINEX #include <stdio.h> int main() { puts(SONG); return 0; }