home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / WATCOM_C / WAT68.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-21  |  793 b   |  25 lines

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat68.c                                              */
  3. /*------------------------------------------------------------------*/
  4. #include <stdio.h>
  5. #include <math.h>
  6.  
  7. void main()
  8. {
  9.    double x1 =  7.0, y1 = 2.0;
  10.    double x2 = -7.0, y2 = 2.0;
  11.    double x3 =  1.0, y3 = 2.0;
  12.    double x4 =  5.0, y4 = 0.0;
  13.    double result1,result2,result3,result4;
  14.  
  15.    result1 = fmod(x1,y1);
  16.    result2 = fmod(x2,y2);
  17.    result3 = fmod(x3,y3);
  18.    result4 = fmod(x4,y4);
  19.    printf("(%4.1f / %4.1f) = %4.1f\n", x1, y1, result1);
  20.    printf("(%4.1f / %4.1f) = %4.1f\n", x2, y2, result2);
  21.    printf("(%4.1f / %4.1f) = %4.1f\n", x3, y3, result3);
  22.    printf("(%4.1f / %4.1f) = %4.1f\n", x4, y4, result4);
  23.  
  24. }
  25.