From: utzoo!decvax!ucbvax!CAD:tektronix:teklabs!ogcvax!metheus!cdi!caf Newsgroups: net.sources Title: christmas.c Article-I.D.: cdi.138 Posted: Tue Dec 21 02:45:23 1982 Received: Thu Dec 23 02:20:04 1982 /* * Translated from a Pascal program by Pete Mackie * C program by Chuck Forsberg 12-20-82 */ #include char *days[] = { "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eight", "ninth", "tenth", "eleventh", "twelfth" }; char *gifts[] = { "Tvelve drummers drumming", "Eleven pipers piping", "Ten lords a-leaping", "Nine ladies dancing", "Eight maids a-milking", "Seven seans a-swimming", "Six geese a-laying", "Five golden rings", "Four calling Birds", "Three French hens", "Two turtle doves", 0 }; main() { register int day; register char **pp, **qq; for (day = 0, pp = &gifts[11]; day<12; ++day) { printf("On the %s day of Christmas my true love gave to me -\n", days[day]); if(day) { for(qq = --pp; *qq; ++qq) printf("%s,\n", *qq); printf("And a partridge in a pear tree.\n\n"); } else printf("A partridge in a pear tree.\n\n"); } }