home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------*/
- /* ╡{ªí└╔ªW║┘: wat68.c */
- /*------------------------------------------------------------------*/
- #include <stdio.h>
- #include <math.h>
-
- void main()
- {
- double x1 = 7.0, y1 = 2.0;
- double x2 = -7.0, y2 = 2.0;
- double x3 = 1.0, y3 = 2.0;
- double x4 = 5.0, y4 = 0.0;
- double result1,result2,result3,result4;
-
- result1 = fmod(x1,y1);
- result2 = fmod(x2,y2);
- result3 = fmod(x3,y3);
- result4 = fmod(x4,y4);
- printf("(%4.1f / %4.1f) = %4.1f\n", x1, y1, result1);
- printf("(%4.1f / %4.1f) = %4.1f\n", x2, y2, result2);
- printf("(%4.1f / %4.1f) = %4.1f\n", x3, y3, result3);
- printf("(%4.1f / %4.1f) = %4.1f\n", x4, y4, result4);
-
- }