home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / alb_c10 / chap_07 / ch07_06.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-08  |  682 b   |  25 lines

  1. /*********************************************************************
  2. *  CH07_06.C                                 Directives et macros  *
  3. *                   NΘcessitΘ de parenthΦses et effets de bord   *
  4. *********************************************************************/
  5.  
  6. #include<stdio.h>
  7.  
  8. #define Produit1( x, y) ( x* x + y* y)
  9. #define Produit2( x, y) ( (x)*(x) + (y)*(y))
  10.  
  11. main( void)
  12. {
  13.     int a= 2, b= 3;
  14.  
  15.     printf(" Produit1: %d\t Produit2: %d",
  16.          Produit1( a+ 1, b+ 1), Produit2( a+ 1, b+ 1));
  17.  
  18.     printf("\n\n Produit2: %d\t Produit2: %d",
  19.              Produit2( a+ 1, b+ 1), Produit2( a++, b++));
  20. }
  21.  
  22. /*
  23.  Produit1= 12    Produit2= 25
  24.  
  25.  Produit2= 61    Produit2= 18                        */