// Program plays the 12 days of christmas song // Exercise 2.63 from D&D #include main () { int day; cout << "The Twelve Days of Christmas " << endl << endl; for (day = 1; day <= 12; day++) { cout << "On the "; switch (day) { case 1: cout << "first "; break; case 2: cout << "second "; break; case 3: cout << "third "; break; case 4: cout << "forth "; break; case 5: cout << "fifth "; break; case 6: cout << "sixth "; break; case 7: cout << "seventh "; break; case 8: cout << "eighth "; break; case 9: cout << "ninth "; break; case 10: cout << "tenth "; break; case 11: cout << "eleventh "; break; case 12: cout << "twelth "; break; } cout << "day of christmas my true love gave to me " << endl; switch (day) { case 12: cout << "\t 12 drummers drumming, " << endl; case 11: cout << "\t 11 pipers piping, " << endl; case 10: cout << "\t 10 lords a-leaping, " << endl; case 9: cout << "\t 9 ladies dancing, " << endl; case 8: cout << "\t 8 maids a-milking, " << endl; case 7: cout << "\t 7 swans a-swimming, " << endl; case 6: cout << "\t 6 geese a-laying, " << endl; case 5: cout << "\t 5 golden rings, " << endl; case 4: cout << "\t 4 calling birds, " << endl; case 3: cout << "\t 3 french hens, " << endl; case 2: cout << "\t 2 turtle doves, and" << endl; case 1: cout << "\t a partridge in a pear tree. " << endl; } cout << endl; } return 0; }