home *** CD-ROM | disk | FTP | other *** search
- /* Based on an original program written in Algol 68 by John P. Baker University
- of Bristol. (1978) */
-
- #include "partridge.h"
-
- int christmas;
- long x;
-
- main()
- {
- printf("Enter a number between 1 and 12 ");
- scanf("%d",&christmas);
- if (christmas == 0) christmas = 1;
- if ((christmas < 0) || (christmas >12))
- {
- printf("Invalid number\n");
- exit();
- }
- printf("Factorial of %d is ",christmas);
-
-
- The first day of christmas my true love sent to me
- A partridge in a pear tree
-
- The second day of christmas my true love sent to me
- Two turtle doves and
- A partridge in a pear tree
-
- The third day of christmas my true love sent to me
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The fourth day of christmas my true love sent to me
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The fifth day of christmas my true love sent to me
- Five gold rings
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The sixth day of christmas my true love sent to me
- Six geese laying
- Five gold rings
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The seventh day of christmas my true love sent to me
- Seven swans swimming
- Six geese laying
- Five gold rings
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The eighth day of christmas my true love sent to me
- Eight maids milking
- Seven swans swimming
- Six geese laying
- Five gold rings
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The ninth day of christmas my true love sent to me
- Nine drummers drumming
- Eight maids milking
- Seven swans swimming
- Six geese laying
- Five gold rings
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The tenth day of christmas my true love sent to me
- Ten pipers piping
- Nine drummers drumming
- Eight maids milking
- Seven swans swimming
- Six geese laying
- Five gold rings
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The eleventh day of christmas my true love sent to me
- Eleven ladies dancing
- Ten pipers piping
- Nine drummers drumming
- Eight maids milking
- Seven swans swimming
- Six geese laying
- Five gold rings
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
-
- The twelfth day of christmas my true love sent to me
- Twelve lords leaping
- Eleven ladies dancing
- Ten pipers piping
- Nine drummers drumming
- Eight maids milking
- Seven swans swimming
- Six geese laying
- Five gold rings
- Four colly birds
- Three french hens
- Two turtle doves and
- A partridge in a pear tree
- }
-