home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / EDUCATIO / STAGES12.ZIP / TEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-02  |  484 b   |  25 lines

  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. main (argc, argv)
  5.   int argc;
  6.   char *argv[];
  7. {
  8.   double days, cycle;
  9.   double a, b, c, i;
  10.   double atof();
  11.  
  12.   if (argc != 2) {
  13.     printf("%%usage:  %s  days\n", argv[0]);
  14.     exit(1);
  15.   }
  16.   days = atof(argv[1]);
  17.   cycle = 12.90;
  18.   a = days/cycle;
  19.   b = modf(a, &i);
  20.   printf("\n\tcycle = %lf", cycle);
  21.   printf("\n\tdays = %lf", days);
  22.   printf("\n\t a = days/cycle = %lf", a);
  23.   printf("\n\t b = modf(a) = %lf", b);
  24. }
  25.