home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************************
- * CH02_08.C MΘlange de types dans une mΩme expression *
- *********************************************************************/
-
- #include<stdio.h>
-
- main( void)
- {
- int a= 3, b= 4, c, d;
- double t= 3.0, x, y;
-
- c= b/ a;
-
- x= b/ a;
- y= b/ t;
-
- printf(" c= %d\t x= %lf\t y= %lf",c, x, y);
-
- x= 1.0* b/ a;
- y= b/ a* 1.0;
- printf("\n\n x= %lf\t y= %lf", x, y);
-
- d= 1.0* b/ a;
- printf("\n\n d= %d", d);
- }
- /*
-
- c= 1 x= 1.000000 y= 1.333333
-
- x= 1.333333 y= 1.000000 ( y= 1 * 1.0 = 1.000000 )
-
- d= 1 */