home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <math.h>
-
- main (argc, argv)
- int argc;
- char *argv[];
- {
- double days, cycle;
- double a, b, c, i;
- double atof();
-
- if (argc != 2) {
- printf("%%usage: %s days\n", argv[0]);
- exit(1);
- }
- days = atof(argv[1]);
- cycle = 12.90;
- a = days/cycle;
- b = modf(a, &i);
- printf("\n\tcycle = %lf", cycle);
- printf("\n\tdays = %lf", days);
- printf("\n\t a = days/cycle = %lf", a);
- printf("\n\t b = modf(a) = %lf", b);
- }